From cfebeec56699b44a6df3bf257545fb1a32acac32 Mon Sep 17 00:00:00 2001 From: Fede85 Date: Thu, 4 Jul 2013 15:54:30 +0200 Subject: Esplora library to new format --- .../Beginners/EsploraMusic/EsploraMusic.ino | 53 ---------------------- 1 file changed, 53 deletions(-) delete mode 100644 libraries/Esplora/Beginners/EsploraMusic/EsploraMusic.ino (limited to 'libraries/Esplora/Beginners/EsploraMusic/EsploraMusic.ino') diff --git a/libraries/Esplora/Beginners/EsploraMusic/EsploraMusic.ino b/libraries/Esplora/Beginners/EsploraMusic/EsploraMusic.ino deleted file mode 100644 index 7a950fb..0000000 --- a/libraries/Esplora/Beginners/EsploraMusic/EsploraMusic.ino +++ /dev/null @@ -1,53 +0,0 @@ -/* - Esplora Music - - This sketch turns the Esplora in a simple musical instrument. - Press the Switch 1 and move the slider to see how it works. - - Created on 22 november 2012 - By Enrico Gueli - modified 22 Dec 2012 - by Tom Igoe -*/ - - -#include - -// these are the frequencies for the notes from middle C -// to one octave above middle C: -const int note[] = { -262, // C -277, // C# -294, // D -311, // D# -330, // E -349, // F -370, // F# -392, // G -415, // G# -440, // A -466, // A# -494, // B -523 // C next octave -}; - -void setup() { -} - -void loop() { - // read the button labeled SWITCH_DOWN. If it's low, - // then play a note: - if (Esplora.readButton(SWITCH_DOWN) == LOW) { - int slider = Esplora.readSlider(); - - // use map() to map the slider's range to the - // range of notes you have: - byte thisNote = map(slider, 0, 1023, 0, 13); - // play the note corresponding to the slider's position: - Esplora.tone(note[thisNote]); - } - else { - // if the button isn't pressed, turn the note off: - Esplora.noTone(); - } -} -- cgit v1.2.3-18-g5258