The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 864 - File: showthread.php PHP 7.2.24 (Linux)
File Line Function
/showthread.php 864 errorHandler->error




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


Messages In This Thread
attachInterrupt(digitalPinToInterrupt(pin), ISR, mode); - by jwzumwalt - 01-03-2016, 05:15 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)