Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

Close

interrupt0 | Electronics Lab

interrupt0
Version 1 - Last update: Oct 5, 2015

penerapan int0

void setup() { // set the digital pin as output: pinMode(ledPin, OUTPUT); attachInterrupt(0, toggle, FALLING);
}

void toggle() { // if the LED is off turn it on and vice-versa: if (ledState == LOW) ledState = HIGH; else ledState = LOW; // set the LED with the ledState of the variable: digitalWrite(ledPin, ledState); }

void loop() { // Do nothing just loop }

Comments disabled