update main

This commit is contained in:
2021-01-19 11:58:48 +01:00
parent c5d94bd1da
commit c235c1fceb

View File

@@ -40,10 +40,10 @@ struct fanMonitor {
unsigned int last_time;
};
void ICACHE_RAM_ATTR handleInterrupt() {
rpmCount++;
if( rpmCount > 100 ) {
rpmCount=0;
void ICACHE_RAM_ATTR handleInterrupt( struct fanMonitor &fm ) {
fm.rpmcount++;
if( fm.rpmcount > 100 ) {
fm.rpmcount=0;
Serial.println("100 RPM");
}
}
@@ -68,7 +68,7 @@ void setup() {
pinMode(14,INPUT); // 14 = D5
// attachInterrupt(digitalPinToInterrupt(14), handleInterrupt, RISING);
attachInterrupt(14,handleInterrupt,RISING);
// attachInterrupt(14,handleInterrupt,RISING);
}