Compare commits
No commits in common. "73ac905d33773a258718681cffd8ac930edab775" and "7668eda48ac587b0e0a4a29648f938a3f8cf70d6" have entirely different histories.
73ac905d33
...
7668eda48a
8
main.py
8
main.py
@ -71,6 +71,7 @@ now = 0
|
|||||||
last_toggle = 0
|
last_toggle = 0
|
||||||
current_mode = NORMAL
|
current_mode = NORMAL
|
||||||
autostop = True
|
autostop = True
|
||||||
|
timer0 = Timer(0, mode=Timer.PERIODIC, )
|
||||||
|
|
||||||
def ypt(ts):
|
def ypt(ts):
|
||||||
# Bolt insertion rate in cm/s: y'(t)
|
# Bolt insertion rate in cm/s: y'(t)
|
||||||
@ -137,7 +138,8 @@ def setup():
|
|||||||
setup_gpio()
|
setup_gpio()
|
||||||
setup_timer()
|
setup_timer()
|
||||||
|
|
||||||
if not MODE_PIN.value():
|
buttonUp = Pin(MODE_PIN)
|
||||||
|
if not buttonUp:
|
||||||
print("Manual REWIND")
|
print("Manual REWIND")
|
||||||
autostop = False
|
autostop = False
|
||||||
current_mode = REWINDING
|
current_mode = REWINDING
|
||||||
@ -152,8 +154,8 @@ def setup_timer():
|
|||||||
|
|
||||||
|
|
||||||
def setup_gpio():
|
def setup_gpio():
|
||||||
all_pins_off()
|
#all_pins_off()
|
||||||
MODE_PIN.irq(trigger=Pin.IRQ_LOW_LEVEL, handler=toggle_mode)
|
MODE_PIN.irq(trigger=Pin.IRQ_FALLING, handler=toggle_mode)
|
||||||
|
|
||||||
|
|
||||||
def all_pins_off(pin):
|
def all_pins_off(pin):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user