Sunday, November 30, 2014

Baby, It's Cold Outside (LilyPad style)

Lilypad with conductive thread by sameerhalai, on Flickr
Creative Commons Creative Commons Attribution-Noncommercial-Share Alike 2.0 Generic License   by  sameerhalai 

In a previous post, I shared the first musical composition that I coded for my LilyPad, a lullaby that I used to sing to my daughter.  Over the weekend, I sat down and started coding the song "Baby, It's Cold Outside," to get myself in the holiday spirit!  I used this frequency chart to match the notes on the sheet music.  Ideally, I'd like to create a scarf that plays this song and flashes multicolored lights when the temperature dips.

I haven't yet figured out how to program lights to flash in sync with my music, but that is next on my list.  Here is the code that I wrote.

The video is less than thrilling, but you can hear how my song is progressing.  I would appreciate any feedback you might have.