Skip to content
Snippets Groups Projects
Commit 1eaf85c6 authored by schneider's avatar schneider
Browse files

feat(hid): Make the app a bit nicer

parent a0cf6160
No related branches found
No related tags found
1 merge request!382HID over BLE
import hid
import buttons
import color
import display
BUTTON_VOLUME_UP = 1
BUTTON_VOLUME_DOWN = 2
BUTTON_PLAY = 8
disp = display.open()
disp.clear()
disp.print(" card10", posy=0)
disp.print(" Remote", posy=20)
disp.print("Play", posy=60, fg=color.BLUE)
disp.print("Vol+", posy=40, posx=100, fg=color.RED)
disp.print("Vol-", posy=60, posx=100, fg=color.GREEN)
disp.update()
b_old = buttons.read()
while True:
b_new = buttons.read()
......@@ -12,10 +23,10 @@ while True:
print(b_new)
b_old = b_new
if b_new == buttons.TOP_RIGHT:
hid.set_button(BUTTON_PLAY)
elif b_new == buttons.BOTTOM_RIGHT:
hid.set_button(BUTTON_VOLUME_UP)
elif b_new == buttons.BOTTOM_LEFT:
elif b_new == buttons.BOTTOM_RIGHT:
hid.set_button(BUTTON_VOLUME_DOWN)
elif b_new == buttons.BOTTOM_LEFT:
hid.set_button(BUTTON_PLAY)
else:
hid.set_button(0)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment