update main
This commit is contained in:
10
src/main.cpp
10
src/main.cpp
@@ -40,10 +40,10 @@ struct fanMonitor {
|
|||||||
unsigned int last_time;
|
unsigned int last_time;
|
||||||
};
|
};
|
||||||
|
|
||||||
void ICACHE_RAM_ATTR handleInterrupt() {
|
void ICACHE_RAM_ATTR handleInterrupt( struct fanMonitor &fm ) {
|
||||||
rpmCount++;
|
fm.rpmcount++;
|
||||||
if( rpmCount > 100 ) {
|
if( fm.rpmcount > 100 ) {
|
||||||
rpmCount=0;
|
fm.rpmcount=0;
|
||||||
Serial.println("100 RPM");
|
Serial.println("100 RPM");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -68,7 +68,7 @@ void setup() {
|
|||||||
|
|
||||||
pinMode(14,INPUT); // 14 = D5
|
pinMode(14,INPUT); // 14 = D5
|
||||||
// attachInterrupt(digitalPinToInterrupt(14), handleInterrupt, RISING);
|
// attachInterrupt(digitalPinToInterrupt(14), handleInterrupt, RISING);
|
||||||
attachInterrupt(14,handleInterrupt,RISING);
|
// attachInterrupt(14,handleInterrupt,RISING);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user