Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
attachInterrupt(digitalPinToInterrupt(pin), ISR, mode);
01-03-2016, 05:15 PM, (This post was last modified: 05-03-2016, 03:43 AM by jwzumwalt.)
#1
attachInterrupt(digitalPinToInterrupt(pin), ISR, mode);
The format for using attachInterrupt() is shown at

https://www.arduino.cc/en/Reference/AttachInterrupt

a simple example is shown

Code:
int pin = 13;
volatile int state = LOW;

void blink() {
   state = !state;
}

void setup() {
   pinMode(pin, OUTPUT);
   attachInterrupt(pin, blink, CHANGE);
}

void loop() {
   digitalWrite(pin, state);
}

I can't get this to work. Does anyone have a successful use of attachInterrupt()?

attachInterrupt() appears to not work in Pinguino, has anyone else confirmed this?
----------------
Thanks,
j
wzumwalt
 (\__/)
 (='.'=)
 (")_(")
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)