const int led = 21;
const int button = 32;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(led, OUTPUT);
pinMode(button, INPUT_PULLDOWN);
}
void loop() {
//DUS DE STATUS VAN DE KNOP IS WEERGEGEVEN ALS EEN BOOLEAN ( 0 OF 1 )
bool status_buttonKnipper = digitalRead(button);
// INLEZEN VAN DE KNOP
//GEEF DE STATUS WEER VAN DE KNOP
Serial.println(("Status button =" + String(status_buttonKnipper)));
// DE STATUS VAN DE BUTTON WORDT DOORGEGEVEN NAAR DE LED
// LET OP DE AANSLUITING VAN DE PINNEN
digitalWrite(led,status_buttonKnipper);
delay(100);
}