HID USB Button box controller?

RP2040 based microcontroller boards running MicroPython.
Target audience: MicroPython users with an RP2040 boards.
This does not include conventional Linux-based Raspberry Pi boards.
Post Reply
Spr00l
Posts: 4
Joined: Tue Feb 02, 2021 1:50 pm

HID USB Button box controller?

Post by Spr00l » Tue Feb 02, 2021 3:57 pm

I have a 6 x 5 matrix button box as USB game controller, with 4 rotary encoders, its driven by a Teensy2 but there's pin limitations. I want to build one with more buttons and rotaries so I bought a Pi Pico, and am now searching for examples of suitable code I can adapt to get the project running. So far I cannot find anything. I learnt enough Teensy/Arduino C to get the Teensy running fine but I have no clue when it comes to micropython.
Any assistance you can give re matrix button boxes & rotary encoders for a usb HID would be much appreciated!

User avatar
jimmo
Posts: 2244
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: HID USB Button box controller?

Post by jimmo » Thu Feb 04, 2021 5:56 am

Spr00l wrote:
Tue Feb 02, 2021 3:57 pm
Any assistance you can give re matrix button boxes & rotary encoders for a usb HID would be much appreciated!
Although MicroPython supports HID on other boards (e.g. pyboard), it's not (yet) supported on the Pico.

However, you might want to take a look at CircuitPython, I believe they have HID support in their Pico port.

tannewt
Posts: 49
Joined: Thu Aug 25, 2016 2:43 am

Re: HID USB Button box controller?

Post by tannewt » Mon Feb 08, 2021 11:11 pm

Yup, we do have HID support. You can get CircuitPython for the Pico here: https://circuitpython.org/board/raspberry_pi_pico/ and the getting started guide is here: https://learn.adafruit.com/getting-star ... cuitpython

We don't currently support rotary encoders but it's on our TODO list (it uses the `rotaryio` module.) Here is our HID example from the essentials guide: https://learn.adafruit.com/circuitpytho ... -and-mouse

Spr00l
Posts: 4
Joined: Tue Feb 02, 2021 1:50 pm

Re: HID USB Button box controller?

Post by Spr00l » Wed Feb 10, 2021 1:29 pm

Thanbks - we had some dialog in the Discord over last few days. I tried rotaryio on pico using circuitpython but it returned an error. Now I understand why. The rotary encoders are pretty much fundamental to my project, looking forward to some updates :)

User avatar
Angainor
Posts: 15
Joined: Thu Sep 24, 2020 9:14 am

Re: HID USB Button box controller?

Post by Angainor » Wed Feb 10, 2021 6:03 pm

Eagerly waiting for USB_HID to be supported on Stock Micropython as well, not just circuit python.

From what I saw, main troubles could be with cmake setup, since all needed code exists already in a place or another.

Do you know if someone actively works on this?

Spr00l
Posts: 4
Joined: Tue Feb 02, 2021 1:50 pm

Re: HID USB Button box controller?

Post by Spr00l » Sun Feb 14, 2021 2:10 pm

tannewt wrote:
Mon Feb 08, 2021 11:11 pm
Yup, we do have HID support. You can get CircuitPython for the Pico here: https://circuitpython.org/board/raspberry_pi_pico/ and the getting started guide is here: https://learn.adafruit.com/getting-star ... cuitpython

We don't currently support rotary encoders but it's on our TODO list (it uses the `rotaryio` module.) Here is our HID example from the essentials guide: https://learn.adafruit.com/circuitpytho ... -and-mouse
Im in a dilemna - HID works on circuitpython but not micropython, I now have working rotary encoders in micropython but they wont yet work in circuitpython, I also now have C/C++ capability via Win10 and visual stodio code but cant port over my teensy2 project as i need access to keypad and joystick library.

arj
Posts: 6
Joined: Wed Feb 03, 2021 5:45 pm

Re: HID USB Button box controller?

Post by arj » Mon Feb 15, 2021 8:23 pm

Anyone have any idea when USB_HID will be added for the Pico?

Post Reply