Hello
Im trying to trigger an ADC read based on a pin changing state using an interrupt.
After a lot of debugging a bit Ive come to the realization that not even the most basic code using interrupts does not work for me, neither dose the example in the arduino documentation for the attachInterrupt() function.
For example the code below found on the forums will never execute the statement in the interrupt(I tried supplying a square wave and short pulses). Im not sure if Im missing something or is it possible that this is caused by damage to the board? Are there alternative ways of implementing pin interrupts? I cant run the intervalTimer() either (the interrupt statements dont seem to execute) but using PDB interrupts with the ADC works.
(https://forum.pjrc.com/threads/2490...ovide-guidance?p=40284&viewfull=1#post40284):
Im trying to trigger an ADC read based on a pin changing state using an interrupt.
After a lot of debugging a bit Ive come to the realization that not even the most basic code using interrupts does not work for me, neither dose the example in the arduino documentation for the attachInterrupt() function.
For example the code below found on the forums will never execute the statement in the interrupt(I tried supplying a square wave and short pulses). Im not sure if Im missing something or is it possible that this is caused by damage to the board? Are there alternative ways of implementing pin interrupts? I cant run the intervalTimer() either (the interrupt statements dont seem to execute) but using PDB interrupts with the ADC works.
(https://forum.pjrc.com/threads/2490...ovide-guidance?p=40284&viewfull=1#post40284):
Code:
#define PinInt1 23
void setup() {
Serial.begin(115200);
pinMode(PinInt1, INPUT_PULLUP); // sets the digital pin as output
attachInterrupt(PinInt1, isrService, FALLING); // interrrupt 1 is data ready
}
void loop()
{
delay(1000);
Serial.println("Running");
}
// watermark generates this interrupt
void isrService()
{
Serial.println("At ISR0");
}
Last edited by a moderator: