diff --git a/build/shared/examples/2.Digital/StateChangeDetection/StateChangeDetection.pde b/build/shared/examples/2.Digital/StateChangeDetection/StateChangeDetection.pde index d6458934a..33f997c6b 100644 --- a/build/shared/examples/2.Digital/StateChangeDetection/StateChangeDetection.pde +++ b/build/shared/examples/2.Digital/StateChangeDetection/StateChangeDetection.pde @@ -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. diff --git a/build/shared/examples/2.Digital/toneMelody/toneMelody.pde b/build/shared/examples/2.Digital/toneMelody/toneMelody.pde index 941084ae4..debcebd6b 100644 --- a/build/shared/examples/2.Digital/toneMelody/toneMelody.pde +++ b/build/shared/examples/2.Digital/toneMelody/toneMelody.pde @@ -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); } }