Exit gracefully

This commit is contained in:
Dr. Simon Levy
2016-08-10 16:38:17 -04:00
parent 043c14339f
commit 4c8255711e
2 changed files with 5 additions and 10 deletions

View File

@@ -104,9 +104,9 @@ def main():
display.displayRobot((x_mm, y_mm, theta_degrees))
# Exit gracefully if user closes display
key = display.refresh()
if key != None and (key&0x1A):
if not display.refresh():
exit(0)
# XXX Add delay for real-time plot