Hello everybody,
I'm building a simple weather station based on the sparkfun sen 08942 hardware. --> Datasheet
My circuit consists out of a Teensy 2 ++ and the aneometer directly wired. (the other ones I don't need in the moment)
Now in order to log this properly I use the
function. It works. However the interrupt is not triggered correctly. More precisely it gets triggered three times while the switch actually only closes once.
I use the simplest code for testing:
As you see the aneometer is connected to the D1 pin on the ++.
The strange thing is, that once I switch from the teensy to an Arduino Uno, the issue is gone and he's counting the revs correctly.
I guess this has to do with the Teensy 2 ++ hardware, but I don't know what it is. Can someone may point me out what I have to change in my circuit to get it running properly?
Thanks in advance.
I'm building a simple weather station based on the sparkfun sen 08942 hardware. --> Datasheet
My circuit consists out of a Teensy 2 ++ and the aneometer directly wired. (the other ones I don't need in the moment)
Now in order to log this properly I use the
Code:
attachInterrupt(0, functionanme, FALLING);
function. It works. However the interrupt is not triggered correctly. More precisely it gets triggered three times while the switch actually only closes once.
I use the simplest code for testing:
Code:
volatile int aneoRevs = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(1, INPUT_PULLUP);
attachInterrupt(1, aneometer, FALLING);
}
void aneometer() {
aneoRevs++;
Serial.println(aneoRevs);
}
void loop() {
// put your main code here, to run repeatedly:
}
As you see the aneometer is connected to the D1 pin on the ++.
The strange thing is, that once I switch from the teensy to an Arduino Uno, the issue is gone and he's counting the revs correctly.
I guess this has to do with the Teensy 2 ++ hardware, but I don't know what it is. Can someone may point me out what I have to change in my circuit to get it running properly?
Thanks in advance.
Last edited: