Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const int buttonPin = 7;
- int buttonState = 0;
- void setup() {
- pinMode(LED_BUILTIN, OUTPUT);
- pinMode(buttonPin, INPUT);
- }
- void loop() {
- buttonState = digitalRead(buttonPin);
- if (buttonState == HIGH) {
- digitalWrite(LED_BUILTIN, HIGH);
- } else {
- digitalWrite(LED_BUILTIN, LOW);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement