diff --git a/preload/apps/hid.py b/preload/apps/hid.py index 4f594633c057a29c51a00dc834516c9a6c756794..fdf47a52a0c5d860ac0fe43acb3935d81f37c684 100644 --- a/preload/apps/hid.py +++ b/preload/apps/hid.py @@ -1,10 +1,21 @@ 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)