I don’t understand where things are going wrong – specifically why is the handleIinterrupt() function being triggered when the fan is operating under PWM control by the esp?Īnother note: For some reason if any value other than 0 is provided to the pin argument in the attachInterrupt('pin', 'ISR', 'mode') function the fan speed recorded in the serial monitor is 0 RPM. The value of interruptCounter variable in the computFanSpeed() function gets to 4180 before it is reset to zero after exiting loop(). When this PWM signal is connected to the PWM input of the fan it responds as expected, however the speed reported in the serial monitor climbs to a non-sensible number (123300 RPM). The PWM signal originates from esp pin D1 and is measured to be 2.0V using a multimeter. I have used the debugging tools in VisualMicro to watch the vaue of the interruptCounter variable in the computFanSpeed() function during operation and its value gets to 49 before it is reset to zero after exiting loop(). When the system is connected in this state (no PWM signal) the fan speed is at maximum and its speed is correctly reported in the serial monitor at approximately 1410 RPM.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |