RichardFerraro
Well-known member
I have Nunchuck working and ADXL345 accelerometer partially working using TeensyDuino with Teensy 3.1.
I want to generate an interrupt when the signal on a pin changes (e.g., goes low) so that I can access data from the ADXL345.
I know how to do this on Arduino MEGA as pins are dedicated to certain interrupts.
Mega pin 2 (interrupt 0),
attachInterrupt(0, ISR0_ADXL345_WATERMARK, FALLING); // watermark
void ISR0_ADXL345_WATERMARK() {...} // ISR
I don't know how to do this on Teensy 3.1 as I understand any pin can be configured to generate an interrupt.
For example, suppose pin is 23 receives an interrupt signal from the ADXL345.
What does the software look like that would:
configure pin 23 to generate an interrupt?
specify the interrupt handler that will be called when pin 23 changes (e.g., goes low)?
thanks,
Richard
I want to generate an interrupt when the signal on a pin changes (e.g., goes low) so that I can access data from the ADXL345.
I know how to do this on Arduino MEGA as pins are dedicated to certain interrupts.
Mega pin 2 (interrupt 0),
attachInterrupt(0, ISR0_ADXL345_WATERMARK, FALLING); // watermark
void ISR0_ADXL345_WATERMARK() {...} // ISR
I don't know how to do this on Teensy 3.1 as I understand any pin can be configured to generate an interrupt.
For example, suppose pin is 23 receives an interrupt signal from the ADXL345.
What does the software look like that would:
configure pin 23 to generate an interrupt?
specify the interrupt handler that will be called when pin 23 changes (e.g., goes low)?
thanks,
Richard