int button1 = 13;
void setup() {
Serial.begin(115200);
pinMode(button1, INPUT_PULLUP);
pinMode(21, OUTPUT);
}
void loop() {
while(digitalRead(button1) == LOW){
digitalWrite(21, HIGH);
}
digitalWrite(21, LOW);
}
int button1 = 13;
void setup() {
Serial.begin(115200);
pinMode(button1, INPUT_PULLUP);
pinMode(21, OUTPUT);
}
void loop() {
while(digitalRead(button1) == LOW){
digitalWrite(21, HIGH);
}
digitalWrite(21, LOW);
}