Lesson 7: Python For Kids V2 (Part 7: FUN With Music)

Lesson 7: Python For Kids V2 (Part 7: FUN With Music)

For a complete table of contents of all the lessons please click below as it will give you a brief of each lesson in addition to the topics it will cover. https://github.com/mytechnotalent/Python-For-Kids

IS EVERYONE EXCITED? IS EVERYONE READY TO GET THEIR JAM ON?

Today we are going to have FUN with our little friend and have him jam out some tunes for us as the party starts right now!

If your micro:bit is not connected to the micro:bit MicroPython Web Editor, please follow the steps in Lesson 2, specifically STEP 2 and STEP 3:

STEP 2: Connect Your micro:bit V2 Into Your Computer

STEP 3: Press The Connect Button In The micro:bit MicroPython Web Editor

If you are connected you are all ready to start!

STEP 1: Open micro:bit MicroPython Web Editor

STEP 2: Type Code & Name It music_program

from music import *
	

	play(NYAN)

STEP 3: Click Save

No alt text provided for this image

STEP 4: Click Download Python Script

No alt text provided for this image

STEP 5: Click Flash

No alt text provided for this image

STEP 7: SEE THE FUN AS OUR NEW FRIEND IS JAMMIN OUT HIS FAVORITE TUNE!

(Use your headphones to hear our friend jammin his favorite song.)

It's your turn! Ask our little friend to play some of his other favorite songs for you! You can try something like this on line 3 by replacing line 3 in our code with one of the below statements to which you will SAVE, DOWNLOAD and FLASH as described above.

Here’s a list of the built-in songs:

  • play(DADADADUM)
  • play(ENTERTAINER)
  • play(PRELUDE)
  • play(ODE)
  • play(RINGTONE)
  • play(FUNK)
  • play(BLUES)
  • play(BIRTHDAY)
  • play(WEDDING)
  • play(FUNERAL)
  • play(PUNCHLINE)
  • play(PYTHON)
  • play(BADDY)
  • play(CHASE)
  • play(BA_DING)
  • play(WAWAWAWAA)
  • play(JUMP_UP)
  • play(JUMP_DOWN)
  • play(POWER_UP)
  • play(POWER_DOWN)

Feel free to share your code in the comments below! I would LOVE to see what YOU create!

In our next lesson we will have some FUN with talking robots!

要查看或添加评论,请登录

Kevin Thomas的更多文章

社区洞察

其他会员也浏览了