mirror of
https://github.com/KevinMidboe/Arduino.git
synced 2025-10-29 17:40:11 +00:00
Init commit with many years of arduino sketches and projects. I dont know if the esp8266 includes much, but there are also libraries. I hope they dont have crazy automatic versioning through the Arduino IDE.
This commit is contained in:
21
Projects/_5_buttonTest/_5_buttonTest.ino
Normal file
21
Projects/_5_buttonTest/_5_buttonTest.ino
Normal file
@@ -0,0 +1,21 @@
|
||||
const int buttonPin0 = 0;
|
||||
|
||||
const int led = 13;
|
||||
|
||||
void setup() {
|
||||
pinMode(buttonPin0, INPUT);
|
||||
pinMode(led, OUTPUT);
|
||||
|
||||
Serial.begin(9600);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
if (analogRead(buttonPin0) == 0) {
|
||||
digitalWrite(led, HIGH);
|
||||
}
|
||||
else {
|
||||
digitalWrite(led, LOW);
|
||||
}
|
||||
|
||||
delay(1000);
|
||||
}
|
||||
Reference in New Issue
Block a user