1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-02-20 14:54:31 +01:00

bug fixes to StateChangeDetection and ToneMelody examples

This commit is contained in:
Tom Igoe 2010-10-14 14:46:51 -04:00
parent 9cad196ae5
commit 81de2b5a05
2 changed files with 8 additions and 5 deletions

View File

@ -16,7 +16,7 @@
most Arduino boards)
created 27 Sep 2005
modified 30 Dec 2009
modified 14 Oct 2010
by Tom Igoe
This example code is in the public domain.
@ -64,11 +64,11 @@ void loop() {
// wend from on to off:
Serial.println("off");
}
// save the current state as the last state,
//for next time through the loop
lastButtonState = buttonState;
}
// save the current state as the last state,
//for next time through the loop
lastButtonState = buttonState;
// turns on the LED every four button pushes by
// checking the modulo of the button push counter.

View File

@ -7,6 +7,7 @@
* 8-ohm speaker on digital pin 8
created 21 Jan 2010
modified 14 Oct 2010
by Tom Igoe
This example code is in the public domain.
@ -38,6 +39,8 @@ void setup() {
// the note's duration + 30% seems to work well:
int pauseBetweenNotes = noteDuration * 1.30;
delay(pauseBetweenNotes);
// stop the tone playing:
noTone(8);
}
}