Jan-25-2019, 03:58 AM
seems like my code keeps running if i use this to create a pause. this isn't exactly my goal. I need to "pause" the code for a period of time. but if an "emergency stop" button is pressed during the pause id like to run a final line of code (which stops the machine) and halt all further operation of code.
thanks
thanks
########libraries######## import csv from threading import Timer ########variables######## servo1pos = '' servo2pos = '' rtkgpspos = '' compasspos = '' delay_in_sec = 5 ########Functions######## def countdelay(delay_in_sec): print("in function") def yes(): print("sure is") ########Main Code######## print("go") t = Timer(delay_in_sec, countdelay, [delay_in_sec]) # countdelay function will be called 2 sec later with [delay_in_sec] as *args parameter t.start() # returns None print("done") print("is other code executing?") yes()