I know some will freak out a little about the use for a Fritzing image, but as a noob I found it really helped me understand the schematics.
Sorry if this causes anyone to stress out, ok.
I got the basic hardware debounce worked out. Thanks to http://www.ikalogic.com/debouncing.php
void setup() {
Serial.begin(9600);
pinMode(2, INPUT); // that orange wire
pinMode(13, OUTPUT);
}
void loop() {
boolean sensorValue = digitalRead(2);
Serial.println(sensorValue);
sensorValue=!sensorValue; // I inverse this so the LED is off when no button pressed and on when pressed.
digitalWrite(13,sensorValue);
}
Digitalduino: Arduino Software and Hardware Based Button Debouncing is a great article on debouncing.
It says "Changing the size of the cap will change how long it takes to charge, and thus, how long it takes the digital to become "HIGH"."
It also has the resistor at the ground end of the circuit.
