const int buttonpin1=2;
const int led1=A0;
void setup() {
pinMode(buttonpin1, INPUT_PULLUP);
pinMode(led1, OUTPUT);// put your setup code here, to run once:
}
void loop() {
int buttonstat= digitalRead(buttonpin1);
if(buttonstat==LOW){
digitalWrite(led1, HIGH);// put your main code here, to run repeatedly:
delay(1000);
digitalWrite(led1, LOW);// put your main code here, to run repeatedly:
delay(1000);
}
else
{
digitalWrite(led1, LOW);
}
}
//1 in push button wiring is same node with 1r