jfedor2 / magellan-spacemouse

Adapter to use RS-232 Magellan/SpaceMouse with modern software
38 stars 8 forks source link

Pintf support with tinyusb / spacemouse emulation #4

Open cuzzo94 opened 9 months ago

cuzzo94 commented 9 months ago

Hi, i'm not sure if this is the right place to ask, but I'm having troubles adapting this code to my needs. I'm trying to write a program to emulate a spacemouse using an IMU sensor, and to test the program i'd need some debug prints to check the values obtained by the sensor. I see that you use the function "printf" in your code, but with the tinyusb firmware loaded the pico isn't recognized as a serial device, so i can't read those prints anywhere.
I tryed to follow some examples i found online to enable CDC communication in the descriptor / tusb_config files, but unless i'm doing something wrong (likely) that seems to break the comunication with the spacemouse software. Did you find a way to receive those prints somehow? Or do you have a better debugging method to suggest? Thank you.

jfedor2 commented 9 months ago

It's possible to have CDC and HID at the same time, but I normally just use a separate USB-UART adapter. Wire it to a TX pin on the board and you can printf without changing anything in the code.