(Jul-04-2019, 05:31 PM)noisefloor Wrote: Thus the request to show more code. Otherwise, nobody can help you.He did post a link to all code on Github in his post.
@TeeMan the code has several errors and do not look good,
SyntaxError
is always simple errors.Do not 1-space as indentation,in Python is always 4-space.
To clean most up,i can of course not run this code for testing.
def main(): index = 0 gpsp = GpsPoller() # create the thread try: gpsp.start() # start it up while index == 1: lcd.lcd_clear() printMessage_1() time.sleep(2) lcd.lcd_clear() printMessage_2() time.sleep(2) lcd.lcd_clear() printMessage_3() time.sleep(7) lcd.lcd_clear() printMessage_4() time.sleep(2) lcd.lcd_clear() printMessage_5() time.sleep(3) lcd.lcd_clear() printMessage_6() time.sleep(3) lcd.lcd_clear() printMessage_7() time.sleep(3) lcd.lcd_clear() printMessage_8() time.sleep(5) lcd.lcd_clear() printMessage_9() time.sleep(3) lcd.lcd_clear() printMessage_10() time.sleep(5) index += 1 while True: lcd.lcd_clear() printMessageTime() time.sleep(7) lcd.lcd_clear() printMessageAltitude() time.sleep(7) lcd.lcd_clear() printMessageQTH() time.sleep(7) except Exception as error: print(error) if __name__ == '__main__': try: main() except (KeyboardInterrupt, SystemExit): gpsp.running = False gpsp.join()You had a
try
without a except
.So added this to avoid SyntaxError.
except Exception as error: print(error)