Merge pull request #2 from funnym0nk3y/master

Update print to print()
This commit is contained in:
DriftKingTW 2021-02-03 01:29:06 +08:00 committed by GitHub
commit 58b950fa40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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