Created
March 24, 2024 01:28
-
-
Save SuperSonicHub1/1e70cc6ca3bde61404605b3e5faa3e0b to your computer and use it in GitHub Desktop.
USB Remote Start/Stop for WMBR w/ CircuitPython
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Made by Kyle Williams for WMBR, 2024 M03 | |
# This code is public domain under the Unlicense: https://unlicense.org/ | |
import usb_hid | |
import usb_midi | |
from adafruit_hid.consumer_control import ConsumerControl | |
from adafruit_hid.consumer_control_code import ConsumerControlCode | |
import adafruit_midi | |
from adafruit_midi.start import Start | |
from adafruit_midi.stop import Stop | |
cc = ConsumerControl(usb_hid.devices) | |
midi = adafruit_midi.MIDI(midi_out=usb_midi.ports[1], out_channel=0) | |
def send_play(): | |
cc.send(ConsumerControlCode.PLAY_PAUSE) | |
midi.send(Start()) | |
def send_stop(): | |
cc.send(ConsumerControlCode.STOP) | |
midi.send(Stop()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment