Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const byte ledPin = 13;
- const byte interruptPin = 2;
- volatile byte state = LOW;
- void setup() {
- pinMode(ledPin, OUTPUT);
- pinMode(interruptPin, INPUT_PULLUP);
- attachInterrupt(digitalPinToInterrupt(interruptPin), blink, CHANGE);
- }
- void loop() {
- digitalWrite(ledPin, state);
- }
- void blink() {
- state = !state;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement