This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
scicopath | |
subcribe www.youtube.com/scicopath | |
*/ | |
#define led_pin 13 | |
#define button 12 | |
boolean data=false; | |
boolean value; | |
void setup() { | |
pinMode(led_pin,OUTPUT); | |
pinMode(button,INPUT); | |
digitalWrite(led_pin,data); | |
} | |
void loop() { | |
value=digitalRead(button); | |
if(value==1) | |
{ | |
data=!data; | |
delay(500); | |
} | |
digitalWrite(led_pin,data); | |
} |