/* -------------------- Tones Scale ----------------------- * "do re mi fa sol la ti do" * Hardware Setup- * -Wire a piezo disk between digital pin 6 and Gnd * *------------------------------------------------------------*/ int piezoPin = 6; int tones[] = {261, 294, 330, 349, 392, 440, 490, 525}; // frequencies //------- note C D E F G A B C void setup() { pinMode(piezoPin, OUTPUT); // Set the digital LED pin as an output } void loop() { for(int i = 0; i < 8; i=i + 1){ tone(piezoPin, tones[i], 300); // syntax: tone(pin, freq, duration) delay(400); } } |