Will it work if I connect a mouse instead of a keyboard, will i have to make some changes on the code for that? I see the code has functions regarding mouse events as well
I made a video on usb ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-fEDp9053eZs.html. also this is the first one you should probably watch. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-yIXa-6DRW-Y.html
how can i use the keyboard inputs for the pico, like pressing a key for like lighting up an led when caps lock is activated or something? like that, could be pretty useful imo
Well in the main loop you can look for a given pin and toggle it high. If its helpful i have a simpler version of this, which is just a keyboard input. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-yIXa-6DRW-Y.html
Can this do SD card so the input key data can be looked up in SD card and output a string to computer? Being able to make any keypad/board a helper for disabled persons. Maybe include mouse functions so a single key press can be mapped to fixed mouse locations. Could work as a OS independent macro keypad/board. Also a kind of steam deck.
Great work! This is exactly what I am trying to do now. I have been researching this for quite a while. Is there a way to inject my own response if certain keys are pressed? For example assigning "ALT + T" to print "K"?
Very similar. You just have to use the function process_mouse_report function like we did for the process_keyboard_report function. From there, their's example online that you can find that will tell you how to use usb mice's.
Sure, the PS2 doesn't use usb for its controller. It has some weird spi interface. Well maby it can use because there's a usb port on it can the rock band controllers work over usb?
@@tompaquette7138 If you use the pico to take in USB and output spi. This should be no problem. I made the above comment because this video shows you how to do usb in and usb out. Which i think you could do. It just might need some weird usb driver.
This is great! I have been using the Earle Philhower Arduino core since I started using the Pico. Do you have any tips on how to make use of your code and keep using the Philhower core?
So you would have to add PIO_code and add the arduino drivers for USB host and setup all the configurations for it. In the actual arduino build. At least thats my interpretation of it. I don't know if can access the low level pio code parts once your running the arduino software.
But i've only ever programmed a normal arduino. So my understanding could be completely off. Its been a long time since i've tried to program one and it was just for turning on little leds and stuff like that.
@@brendenadamczak9283 I did manage to get it working, but now I'm wondering if you have any tips for connecting two USB devices to the Pico at once? Like both a mouse and keyboard. I can get them both to properly send the HID codes when connected separately, but I'm not sure how to do both simultaneously. I have attempted to create two TinyUSB host instances, each with their own pio_config with the respective D+ pin, but only the first device works in that instance.
@@kennyhubbell813 So it sounds like your trying to connect two usb devices from two different usb connections. Is that true? So i made a devices that would take two usb devices that were connected to a usb hub. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ATGZD2AyFkc.html. Code here github.com/brendena/USB_to_PS2_pico
@@brendenadamczak9283How does that work? It only defines one pin and I tracked it down to: hcd_configure( which leads to some application of a struct that I have yet to track down. Is the pin it provides(1?) data + or - is the second pin 2 or 0? Am I even on the right track did I interpret this DP correctly as "Data Pin"?
@@fgregerfeaxcwfeffece It's been a a long time since i looked at this code, But i'm guessing if you replaced PIO_USB_TX_DEFAULT, with a another gpio it will probably work
@@brendenadamczak9283Okay, that would have taken a LOT of experimentation. Since I assumed that to be some setting for the com interface you are using additionally. As from my understand USB Data+/- is not transmit (TX) and receive (RX) but just Data and the same data inverted. So labeling one of those as TX seems let's say "counterintuitive". What is your wiring? Which GPIO is Data+ and which is Data -?
@@fgregerfeaxcwfeffece So this was just taken from the project that made the driver for PIO USB. github.com/sekigon-gonnoc/Pico-PIO-USB/blob/0f747aaa0c16f750bdfa2ba37ec25d6c8e1bc117/src/pio_usb_configuration.h#L38C9-L38C31
...\pico-sdk\lib\tinyusb\src\portable aspberrypi\pio_usb\hcd_pio_usb.c:32:10: fatal error: pio_usb.h: No such file or directory i face such difficulty while compiling , any way to over come , kindly help if possible
So if you look inside "Pico-usb-pio" do you see anything? If not do this "git submodule init" then "git submodule update". Then you should see files in there. Hopefully it builds after that. If that was your problem thats my bad and i updated the docs. If not just message me and i'll try again :)
@@brendenadamczak9283 [driver] Build completed: 00:01:30.302 [build] Build finished with exit code 0 done , instead of using cmd , i downloaded code form git as zip and tried to compile thanks
Probably? So the pico has a wifi board if that makes it easier for you? Then you potentially wouldn't need this PCB board? But to the original question yes. From you pcb you can talk to the pico over the same cable that powers it. You'll want to use the CMC class, which is basically a uart stream of data.
If thats the case it should work no problem. The pico is just acting as a relay at that pont. Put a little ZMQ server on the pico and your all set to talk to your pc
I've never done it. But the first step would be to set the flag for vender specific. github.com/hathach/tinyusb/blob/master/examples/host/hid_controller/src/tusb_config.h#L108
It should look like a much simpler version of the keyboard host example. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-yIXa-6DRW-Y.html. Here are the calls github.com/hathach/tinyusb/blob/master/src/class/vendor/vendor_host.h
@@brendenadamczak9283 Trying this too! Cant get it to work unfortunately. I have a Launchpad and I want to use it Standalone with the Pico as the Host. Looking forward to the next video!