Jun-13-2021, 05:11 AM
OK I did some playing around and apparently I have to add a nested if statement with a break that calls back to detech the button press on the relevant gpio pin.
if keyboard.is_pressed('f'): kit.servo[5].angle=10 print("f is pressed") for I in range (3300): if button13.is_pressed: i = 3300 break kit1.stepper1.onestep(direction=stepper.BACKWARD, style=stepper.DOUBLE)
if keyboard.is_pressed('b'): kit.servo[5].angle=110 print("b is pressed") for I in range (3300): if button12.is_pressed: i = 3300 break kit1.stepper1.onestep(direction=stepper.FORWARD, style=stepper.DOUBLE)The thing I have to account for is if the system starts up bound at the edge of travel with GPIO activated at either end.