hthang1988 / arduino

Automatically exported from code.google.com/p/arduino
0 stars 0 forks source link

Debounce example doesn't work as described. #293

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Compile and run Examples > Digital > Debounce example included with the IDE.

What is the expected output? What do you see instead?

According to the documentation at the start of the code and on the website the 
LED should be toggled with each button press.  Instead the LED just matches the 
button state.

What version of the Arduino software are you using? On what operating
system?  Which Arduino board are you using?

0018
MacOS X 10.6.4
Duemilanove

Please provide any additional information below.

I'm attaching a modified version which does what the program is described to 
do.  Feel free to use it as you please.  It may need to be modified to be more 
readable for beginner programmers...

Original issue reported on code.google.com by DKHux...@gmail.com on 16 Jul 2010 at 6:20

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed documentation to reflect the functionality of the sketch

Original comment by s.fitzge...@arduino.cc on 2 Apr 2013 at 7:19

GoogleCodeExporter commented 9 years ago
Scott,

I've looked at the example, but I don't understand one thing: if we want to 
keep the example as is, why we are using debouncing? with the actual behaviour 
it would be simpler to do

digitalWrite(ledPin, digitalRead(buttonPin));

Original comment by c.mag...@arduino.cc on 3 Apr 2013 at 12:24

GoogleCodeExporter commented 9 years ago
Closed with this fix: https://github.com/arduino/Arduino/pull/1192

Original comment by f.vanz...@gmail.com on 16 Apr 2013 at 8:25