1
0
mirror of https://github.com/2martens/uni.git synced 2026-05-06 19:36:26 +02:00

[ES] Blatt 1 und 2 hinzugefügt

Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
2015-04-21 23:49:42 +02:00
parent 7d2ccc24f3
commit 4086b4da40
12 changed files with 2641 additions and 0 deletions

View File

@ -0,0 +1,31 @@
int ledPin = 7;
int buttonPin = 5;
bool ledState = false;
bool buttonHasBeenReset = true;
void setup() {
// put your setup code here, to run once:
pinMode(ledPin, OUTPUT);
pinMode(buttonPin, INPUT);
digitalWrite(ledPin, LOW);
}
void loop() {
// put your main code here, to run repeatedly:
int buttonState = digitalRead(buttonPin);
if (buttonState == LOW && buttonHasBeenReset) {
if (!ledState) {
ledState = true;
digitalWrite(ledPin, HIGH);
}
else {
digitalWrite(ledPin, LOW);
ledState = false;
}
buttonHasBeenReset = false;
}
else if (buttonState == HIGH) {
buttonHasBeenReset = true;
}
delay(10);
}