This is my first thread, so please excuse my newbie errors and mistakes
The first print works just fine, but the second print causes the code to hang up and lock up.
Here is the complete function code
The first print works just fine, but the second print causes the code to hang up and lock up.
Tell controler to excute the task
GPIO.output(Run_Pin, GPIO.HIGH)
#Debug Statement
print(f" Run Pin >> { GPIO.input(Run_Pin) }")
print(f" Setting Busy_Pin True { GPIO.input(Busy_Pin)}").So the question is why is it crashing?Here is the complete function code
def Run_Task() -> None:
# First start the LED flashing thread
# Stop_LED_Flashing = False
# Ready_LED_Flashing = Thread(Set_Ready_LED_Flashing)
# Ready_LED_Flashing.daemon = True
# Ready_LED_Flashing.start()
# Debug Statement
print("Run_Task Telling controller to excute task")
# Tell controler to excute the task
GPIO.output(Run_Pin, GPIO.HIGH)
#Debug Statement
print(f" Run Pin >> { GPIO.input(Run_Pin) }")
print(f" Setting Busy_Pin True { GPIO.input(Busy_Pin)}").
# Wait until stepper controler has started doing task
while(GPIO,input(Busy_Pin) == False):
#Debug Statement
print("Waiting Busy Pin >> false")
sleep(1) #Wait 1 mS to allow logic controler time to respond
# Now wait until stepper controler has finish the task
#Debug Statment
print(" Waiting for Busy_Pin to return to false", GPIO,input(Busy_Pin) )
while(GPIO,input(Busy_Pin) == True):
#Debug Statement
print("Waiting Busy Pin >> True")
sleep(1)
# Control has finshed so return Run pin to false to telling the controller the PI has
GPIO.output(Run_Pin, False)
GPIO.output(Abort_Pin, False)
Stop_LED_Flashing = True
# Debug Statement
print("Run Task completed task Retuning")
returnThanks for sharing your wisdom with me
Thank you for sharing your wisdom
