Páginas

Wednesday, June 15, 2016

Music for All - Playing Melodies in Arduino

Some time ago Brett Hangman did a sample sketch to play melodies using de Arduino Tone Library.

The sketch plays RTTTL songs, this is convenient for micro processors, its simple string with all the information about the melody, tempo, duration and notes. So you don't have a mess with arrays and pointers and also there is thousands of RTTTL songs already made you can download for free, from tv show to popular pop songs.

To make this better we are going to use TimerFreeTone Library from Tim Eckel. This remove the need to use timer1 for tones. That way we can use servos and PWM control for Leds.