int buttonPin = 3;
int buttonState = 0;
void setup(){
void loop(){
int buttonState = 0;
void setup(){
pinMode(buttonPin, INPUT);
Serial.begin(9600);
}Serial.begin(9600);
void loop(){
buttonState = digitalRead(buttonPin);
switch(buttonState){
delay(100);
}switch(buttonState){
case HIGH:
Serial.println("off");
break;
case LOW:
Serial.println("on");
break;
}Serial.println("off");
break;
case LOW:
Serial.println("on");
break;
delay(100);
No comments:
Post a Comment