Move master branch from from mios git repo

This commit is contained in:
hek
2014-01-23 00:23:15 +01:00
commit 609d9e5be9
352 changed files with 53418 additions and 0 deletions
@@ -0,0 +1,52 @@
#include <Bounce2.h>
/*
DESCRIPTION
====================
Simple example of the bounce library that switches the debug LED when a button is pressed.
CIRCUIT
====================
https://raw.github.com/thomasfredericks/Bounce-Arduino-Wiring/master/Bounce/examples/circuit-bounce-change-duration-retrigger.png
*/
#define BUTTON_PIN 2
#define LED_PIN 13
// Instantiate a Bounce object
Bounce debouncer = Bounce();
void setup() {
// Setup the button
pinMode(BUTTON_PIN,INPUT);
// Activate internal pull-up
digitalWrite(BUTTON_PIN,HIGH);
// After setting up the button, setup debouncer
debouncer.attach(BUTTON_PIN);
debouncer.interval(5);
//Setup the LED
pinMode(LED_PIN,OUTPUT);
}
void loop() {
// Update the debouncer
debouncer.update();
// Get the update value
int value = debouncer.read();
// Turn on or off the LED
if ( value == HIGH) {
digitalWrite(LED_PIN, HIGH );
} else {
digitalWrite(LED_PIN, LOW );
}
}