oops, missed a call to time.time()

This commit is contained in:
Brennen Raimer
2019-01-18 16:34:23 -05:00
parent ef828a27f4
commit deedc5d0f0

View File

@@ -3,7 +3,7 @@
import sys
import MySQLdb
from datetime import datetime
from time import sleep
from time import sleep, time
import RPi.GPIO as GPIO
ultraSonicConst = "95"
@@ -40,10 +40,10 @@ try:
GPIO.output(TRIG, False)
while GPIO.input(ECHO) == 0:
pulse_start = time.time()
pulse_start = time()
while GPIO.input(ECHO) == 1:
pulse_end = time.time()
pulse_end = time()
pulse_duration = pulse_end - pulse_start