Update time-light-temp.py

Slight change in timings to allow Google Sheets to align the columns ok. Sped up character input from 1/4 sec to 1/5 second.
This commit is contained in:
Mike Barela 2018-08-02 11:02:46 -04:00 committed by GitHub
parent ca96561c6a
commit eea621ab54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -37,7 +37,7 @@ print("Time\tLight\tTemperature") # Print column headers
def slow_write(string): # Typing should not be too fast for def slow_write(string): # Typing should not be too fast for
for c in string: # the computer to be able to accept for c in string: # the computer to be able to accept
layout.write(c) layout.write(c)
time.sleep(0.25) # use 1/4 second pause between characters time.sleep(0.2) # use 1/5 second pause between characters
while True: while True:
if switch.value: # If the slide switch is on, don't log if switch.value: # If the slide switch is on, don't log
@ -58,10 +58,10 @@ while True:
kbd.release_all() kbd.release_all()
for _ in range(3): for _ in range(3):
kbd.press(Keycode.LEFT_ARROW) kbd.press(Keycode.LEFT_ARROW)
time.sleep(0.01) time.sleep(0.015)
kbd.release_all() kbd.release_all()
time.sleep(0.01) time.sleep(0.025) # Wait a bit more for Google Sheets
led.value = False led.value = False
# Add time.sleep(1.0) to wait more between samples # Change 0.1 to whatever time you need between readings
# Change 1.0 to whatever time you need time.sleep(0.1)