diff --git a/main.py b/main.py index 0a7efe6..30b4dfa 100644 --- a/main.py +++ b/main.py @@ -159,7 +159,7 @@ def setup_gpio(): def all_pins_off(pin): - for i in NUM_PINS: + for i in len(motorPins): pin.value(0) @@ -191,5 +191,10 @@ def toggle_mode(): pass -def loop(): - pass +while True: + if current_mode == REWINDING: + if(totalsteps<1 and autostop): + print("Ending the rewind and stopping") + current_mode = STOPPED + all_pins_off() + total_seconds = 0.0 \ No newline at end of file diff --git a/workspace.code-workspace b/workspace.code-workspace index 545be1f..362d7c2 100644 --- a/workspace.code-workspace +++ b/workspace.code-workspace @@ -1,12 +1,7 @@ { "folders": [ { - "name": "Startracker", "path": "." - }, - { - "name": "serial://dev/ttyUSB0", - "uri": "serial://%2fdev%2fttyusb0/" } ] } \ No newline at end of file