commit
58b950fa40
@ -34,9 +34,9 @@ GPIO.add_event_detect(TACH, GPIO.FALLING, fell)
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
while True:
|
while True:
|
||||||
print "%.f RPM" % rpm
|
print ("%.f RPM" % rpm)
|
||||||
rpm = 0
|
rpm = 0
|
||||||
time.sleep(1) # Detect every second
|
time.sleep(1) # Detect every second
|
||||||
|
|
||||||
except KeyboardInterrupt: # trap a CTRL+C keyboard interrupt
|
except KeyboardInterrupt: # trap a CTRL+C keyboard interrupt
|
||||||
GPIO.cleanup() # resets all GPIO ports used by this function
|
GPIO.cleanup() # resets all GPIO ports used by this function
|
||||||
|
Loading…
Reference in New Issue
Block a user