I want realize a non blocking routine to sample an analog signal at a quit high frequency. For that I just want read the flag in the interrupt register by a specific intervall using a timer interrupt.
My problem is, that following the steps at the pjrc website regarding interrupts leading me to an error.
https://www.pjrc.com/teensy/interrupts.html
Following the simplest version of a piece of code which should compile. I use th Arduino IDE with Teensyduino.
#include <avr/io.h>
#include <avr/interrupt.h>
void setup() {
EIMSK |= (1<<5);
EIFR |= (1<<5);
}
void loop(){
//pass
}
Error -> EIMSK was not declared in this scope.
Same for the EIFR.
I checked also the libraries and it seems like that the descriped registeres are only present for the older libraries teensy 3.x.
Does anyone have an idea how to realize the given approach? I dont want a hardware interrupt which runs the ISR at every bounce. I want a defined samplerate as already explained.
Thank in advance!
My problem is, that following the steps at the pjrc website regarding interrupts leading me to an error.
https://www.pjrc.com/teensy/interrupts.html
Following the simplest version of a piece of code which should compile. I use th Arduino IDE with Teensyduino.
#include <avr/io.h>
#include <avr/interrupt.h>
void setup() {
EIMSK |= (1<<5);
EIFR |= (1<<5);
}
void loop(){
//pass
}
Error -> EIMSK was not declared in this scope.
Same for the EIFR.
I checked also the libraries and it seems like that the descriped registeres are only present for the older libraries teensy 3.x.
Does anyone have an idea how to realize the given approach? I dont want a hardware interrupt which runs the ISR at every bounce. I want a defined samplerate as already explained.
Thank in advance!