Skip to content

Commit

Permalink
mpremote test with CI
Browse files Browse the repository at this point in the history
  • Loading branch information
robin7331 committed Jul 5, 2023
1 parent b8fea50 commit 1aade8b
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
from motor import Motor
import utime
import keyboard
from machine import UART, Pin
import uselect
import sys
import version

# Register Base Addresses

Expand Down Expand Up @@ -176,7 +180,6 @@

# The UI Renderer class holds the frame buffer and the PIO state machine
renderer = UIRenderer()

def SetPadQSPI(pin, d, s):
adr = PAD_QSPI + PAD_QSPI_MPY * pin
n = mem32[adr]
Expand Down Expand Up @@ -315,15 +318,17 @@ def renderBtn(btn):
callback=lambda t: renderer.flush_frame_buffer())

# Lets run a fancy rainbow boot sequence followed by a few relay clicks because we can
run_boot_sequence(renderer, [no_valve, nc_valve, three_way_valve])
# run_boot_sequence(renderer, [no_valve, nc_valve, three_way_valve])

uiTimer.deinit()

rendered_at = 0

k = keyboard.Keyboard()

while True:
run = True

while run:
lift_button.tick()
drop_button.tick()
low_button.tick()
Expand All @@ -341,6 +346,20 @@ def renderBtn(btn):

pixel_pump.tick()

list = uselect.select([sys.stdin], [], [], 0.01)
if list[0]:
# Read entire line from stdin
line = sys.stdin.readline()
line = line.strip()
if line == "trigger:1":
pixel_pump.state.trigger_on()
if line == "trigger:0":
pixel_pump.state.trigger_off()
if line == "version":
print(version.VERSION_STRING)
if line == "halt":
run = False

# Render the UI at 30 FPS.
if utime.ticks_ms() - rendered_at > 33:
renderer.flush_frame_buffer()
Expand Down

0 comments on commit 1aade8b

Please sign in to comment.