Erste Experimente
This commit is contained in:
43
src/main.cpp
Normal file
43
src/main.cpp
Normal file
@@ -0,0 +1,43 @@
|
||||
#include <Arduino.h>
|
||||
|
||||
int Hello = 0;
|
||||
int CanUHearMe = 0;
|
||||
void setup()
|
||||
{
|
||||
|
||||
pinMode(D6, INPUT_PULLUP);
|
||||
pinMode(D5, INPUT_PULLUP);
|
||||
|
||||
Serial.begin(9600);
|
||||
Serial.println("Hallo");
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
if (digitalRead(D5) == LOW && digitalRead(D6) == LOW)
|
||||
{
|
||||
Serial.println("Beide Tasten gedrückt");
|
||||
}
|
||||
|
||||
else if (digitalRead(D5) == LOW && Hello == 0)
|
||||
{
|
||||
Serial.println("Taste 1 gedrückt");
|
||||
Hello = 1;
|
||||
}
|
||||
else if (digitalRead(D6) == LOW && CanUHearMe == 0)
|
||||
{
|
||||
Serial.println("Taste 2 gedrückt");
|
||||
CanUHearMe = 1;
|
||||
}
|
||||
|
||||
if (digitalRead(D5) != LOW)
|
||||
{
|
||||
Hello = 0;
|
||||
}
|
||||
|
||||
if (digitalRead(D6) != LOW)
|
||||
{
|
||||
CanUHearMe = 0;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user