This commit is contained in:
Lukas
2013-05-14 22:03:11 +02:00
parent 732adb8d63
commit 38c35e3e6a
14 changed files with 282 additions and 33 deletions
@@ -0,0 +1,20 @@
const int buttonPin = 2; // the number of the pushbutton pin
const int ledPin = 13; // the number of the LED pin
void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
digitalWrite(buttonPin, HIGH);
}
void loop(){
int buttonState = digitalRead(buttonPin);
if (buttonState == LOW) {
digitalWrite(ledPin, HIGH);
}
else {
digitalWrite(ledPin, LOW);
}
}