Last active
August 29, 2015 14:04
-
-
Save git2samus/47c184274161038eefa2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from datetime import datetime, timedelta | |
| last_seen = datetime.now() | |
| while True: | |
| serial_input = raw_input() # read from serial port | |
| if serial_input == "[FIT]": | |
| last_seen = datetime.now() | |
| elif datetime.now() - last_seen >= timedelta(minutes=5): | |
| print("reboot") # write to serial port |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment