First Commit
This commit is contained in:
21
Blink/Blink.ino
Normal file
21
Blink/Blink.ino
Normal file
@ -0,0 +1,21 @@
|
||||
int buttonPin = D9;
|
||||
int Led = A4;
|
||||
int buttonState;
|
||||
// the setup function runs once when you press reset or power the board
|
||||
void setup() {
|
||||
// initialize digital pin LED_BUILTIN as an output.
|
||||
pinMode(Led, OUTPUT);
|
||||
pinMode(buttonPin, INPUT);
|
||||
}
|
||||
|
||||
// the loop function runs over and over again forever
|
||||
void loop() {
|
||||
buttonState = digitalRead(buttonPin);
|
||||
if (buttonState == LOW) {
|
||||
digitalWrite(Led, HIGH);
|
||||
|
||||
} else {
|
||||
digitalWrite(Led, LOW);
|
||||
}
|
||||
|
||||
}
|
1
Blink/Blink.txt
Normal file
1
Blink/Blink.txt
Normal file
@ -0,0 +1 @@
|
||||
Turn an LED on and off.
|
Reference in New Issue
Block a user