C2CMC 2017 – Day 24

Phew, I made it! It’s day 24 of my ‘Countdown to Christmas Makes Challenge 2017’. So, with today being Christmas Eve I thought it would be rather apt to end my challenge with the wonderful festive tune, ‘We Wish You a Merry Christmas’, programmed in MicroPython for the BBC micro:bit. Now, on that note and along with the lyrics, I just want to say “Merry Christmas and a Happy New Year everyone!”.

Continue reading →

Countdown to Christmas Makes Challenge 2017 – Day 20

# Frosty The Snowman
# by @KariLawler (Twitter)
# Created: 20/Dec/17, v1.0
from microbit import *
import music

frosty_the_snowman = [
    'g4:8', 'e4:6', 'f4:2',
    'g4:4', 'c5:8', 'b4:2', 'c5:2',
    'd5:4', 'c5:4', 'b4:4', 'a4:4',
    'g4:12', 'b4:2', 'c5:2',
    'd5:4', 'c5:4', 'b4:4', 'a4:2', 'a4:2',
    'g4:4', 'c5:4', 'e4:4', 'g4:2', 'a4:2',
    'g4:4', 'f4:4', 'e4:4', 'f4:4',
    'g4:12', 'r:4'
]

music.set_tempo(bpm = 170)
while True:
    if button_a.is_pressed():
        for note in frosty_the_snowman:
            if note[0] != "r":
                display.show(note[0].upper(), delay=150, wait=False, clear=True)
            music.play(note)