From 2f9b1894d8e6f7e4681c8a461425af2fe372a3a3 Mon Sep 17 00:00:00 2001 From: thatsn0tmysite Date: Fri, 24 Nov 2023 23:24:03 +0100 Subject: [PATCH] implemented loop --- main.py | 11 ++++++++--- workspace.code-workspace | 5 ----- 2 files changed, 8 insertions(+), 8 deletions(-) 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