Dibuat Oleh: HELMY ASWAN DANIEL
04 PUSH BUTTON โ€” 1 LED (INPUT_PULLUP)
1ร—
sketch_button_pullup.ino
/* Push Button โ€” kontrol 1 LED (INPUT_PULLUP) */ const int ledPin    = 13;const int buttonPin = 2; int buttonState = 0; void setup() {  pinMode(ledPin, OUTPUT);  pinMode(buttonPin, INPUT_PULLUP);} void loop() {  buttonState = digitalRead(buttonPin);   if (buttonState == LOW) {   // ditekan    digitalWrite(ledPin, HIGH);  } else {    digitalWrite(ledPin, LOW);  }}
๐Ÿ Beranda
BTNHIGH ยท PIN 13LOW