Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
volatile int NbTopsFan;
int Calc;
int hallsensor = 2;
void rpm ()
{
NbTopsFan++;
}
void setup()
{
pinMode(hallsensor, INPUT);
Serial.begin(9600);
attachInterrupt(0, rpm, RISING);
}
void loop ()
{
NbTopsFan = 0;
sei();
delay (1000);
cli();
Calc = (NbTopsFan * 60 / 5.5);
Serial.print (Calc, DEC);
Serial.print (" Litros/min\r\n");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.