1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-11 22:24:13 +01:00
Arduino/build/shared/examples/02.Digital/toneMultiple/toneMultiple.ino

43 lines
734 B
Arduino
Raw Normal View History

2010-03-08 16:51:02 +01:00
/*
Multiple tone player
Plays multiple tones on multiple pins in sequence
circuit:
* 3 8-ohm speaker on digital pins 6, 7, and 11
created 8 March 2010
by Tom Igoe
based on a snippet from Greg Borenstein
This example code is in the public domain.
http://arduino.cc/en/Tutorial/Tone4
*/
void setup() {
}
void loop() {
2010-03-08 17:42:48 +01:00
// turn off tone function for pin 11:
2010-03-08 16:51:02 +01:00
noTone(11);
2010-03-08 17:42:48 +01:00
// play a note on pin 6 for 200 ms:
2010-03-08 16:51:02 +01:00
tone(6, 440, 200);
delay(200);
2010-03-08 17:42:48 +01:00
// turn off tone function for pin 6:
2010-03-08 16:51:02 +01:00
noTone(6);
2010-03-08 17:42:48 +01:00
// play a note on pin 7 for 500 ms:
2010-03-08 16:51:02 +01:00
tone(7, 494, 500);
delay(500);
2010-03-08 17:42:48 +01:00
// turn off tone function for pin 7:
noTone(7);
// play a note on pin 11 for 500 ms:
2010-03-08 16:51:02 +01:00
tone(11, 523, 300);
delay(300);
}