Hey Guys,
i have a problem with my flew sensor, it toggles from 0,04V to 5V for giving me the flewrate. So i want to count the changes (impulse) of the signal.
Therefor i used the AttachedInterrupt method but unfurtunatly its not working properly
I just plugged in the signal into the INT0 (PIN2). So maybe you could review my "test"-code for troubleshooting.. i also added a shematic of the wiring.
Thanks a lot!
Greetings,
Rudi.
SerialOutput (while Sensor is toggling between 0,04V and 5V):
0
0
0
0
..
#include <PinChangeInt.h>
#include <PinChangeIntConfig.h>
#define PIN 2
#define INT 0
volatile long impuls=0;
void setup ()
{
Serial.begin(9600);
pinMode(PIN, INPUT);
attachInterrupt(INT, impulscount, CHANGE);
}
void impulscount()
{
impuls=impuls+1;
}
void loop ()
{
Serial.println(impuls);
delay(1000);
}