Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : Questions about RPi20404 and USB
Author | Message | ||||
Quazee137 Guru Joined: 07/08/2016 Location: United StatesPosts: 570 |
I have been helping a few elderly folks like me play with MMBasic. My need is to have an RPi2040 take input from a USB keyboard that is a separate one from main USB keyboard. Do a lookup on and SD card and send out the text linked to the key hit. I have been using a BADUSB arduino with 8 keys. To change the text sent require uploading the code with new text changes. The keyboard USB id:vendor used for macro's could be passed on and used as the RPi2040 USB id:vendor to the computer. I got a few of the wireless USB keypads to try and test. There is another use for something like this is disabled kids. I am not sure if it can be done in MMBasic but C would be better. My neighbor is going to play with Circuitpython. He tried using a tablet its just not the same as hitting a real key. Any thoughts Thanks Quazee137 |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 9111 |
The PicoMite USB firmware does support more than one keyboard but can't currently distinguish between them - i.e. same as windows, key presses on both keyboards are treated the same. If you can get the keypad to send characters that aren't normally used then you could easily use those to trigger text string. The easiest approach would be to define function key strings that the keypad could trigger. |
||||
bigmik Guru Joined: 20/06/2011 Location: AustraliaPosts: 2914 |
Hi Quazee, All, Why not use a USB-PicoMite with a USB keyboard plugged in as the console and then use a USB-TTL uart to a com port and use it as the “macro” input. Regards, Mick . Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<< |
||||
bigmik Guru Joined: 20/06/2011 Location: AustraliaPosts: 2914 |
Ignore, duplicate post again Regards, Mick . Edited 2024-04-09 19:31 by bigmik Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<< |
||||
Quazee137 Guru Joined: 07/08/2016 Location: United StatesPosts: 570 |
It needs to be act as USB keyboard. The RPi2040 takes input an does a lookup in SD file and then send the text string associated with the key pressed on keypad as if typed on keyboard. Hopes this help see better what I am wanting to do. Quazee137 It could be treated/thought of as a stream deck but using any USB keyboard as the input device. |
||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4226 |
Hi Quazee, Maybe a stupid question. Do you want to use this to open a file browser on a certain page with a single key press ? Or do you plan to run a key handler on the PC that does that for you.? Volhout PicomiteVGA PETSCII ROBOTS |
||||
Quazee137 Guru Joined: 07/08/2016 Location: United StatesPosts: 570 |
ok like this I press 0 on the keypad and the RPi2040 looks up 0 and finds this text "Hello World" then the RPi2040 sends that out as if it was typed in. Example of lookup table 0,Hello World 1,This is a test 2,print "testing" 3,option list 4,The quick brown fox jumps over the lazy dog 5,each lookup slot can have any number of alphanumeric characters 6,and even things like VT100 codes the idea is to make any key on keypad or even a keyboard map to text and control characters going to computer. The computer still has its main keyboard. if you plug 2 USB keyboard into computer all keys work as if 1 keyboard. Here the RPi2040 takes USB key data in and sends what ever is mapped to that key out as if coming from a keyboard. using the SD card means you only need to edit the lookup table. Aw like the Sinclair ZX80 keywords but independent of OS no program needs to do any interpretation. Quazee137 |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 6784 |
The RP2040 only has one USB port. The Pico USB system puts it into Host mode so that it can be used with a keyboard or whatever, so it can't be connected to a PC (which is also a Host). If you then want to connect the same Pico to a terminal it has to be done over a COM port, using a TTL-USB converter for most PCs. If your wireless keypad is USB then the link to the PC has to be over a COM port and you will have to be running a terminal emulator on the PC. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
scruss Regular Member Joined: 20/09/2021 Location: CanadaPosts: 83 |
You might want to take a look at some of the assistive devices from Makers Making Change. They're all open source, and a few of them use CircuitPython to emulate keyboards. (I use to work for Makers Making Change, but haven't for some years now) |
||||
Quazee137 Guru Joined: 07/08/2016 Location: United StatesPosts: 570 |
Scruss THANKS for the link I passed it on to a few I know can really use make use of some of what I seen. What I'm working on is a device that can take any USB keyboard/pad and turn it in to a macro keyboard/pad OS independent. USB keyboard/pad plugs in and the device will convert the keys to macros and send them out as if its a main keyboard/pad. Making any keyboard/pad work like the stream decks do. But no buttons on a box. Right now looking at 2 waveshare RPi2040 Zero's. One gets the data from keyboard/pad looks up the macro assigned to the key hit and maybe using spi to 2nd Zero to act as USB keyboard going to computer. Using an SD card would make it easy to change the macros. Hold down a button on 2nd Zero would make the SD card available as a reader so the table can be modified or just plug card in to computer and edit the table. maybe have a display to the macro the key is sending. more to think about there. I have been looking at some others work using CircuitPython to see how to work up the key definitions and how they are represented. Even some mouse functions. Quazee137 I know there are macro keyboards but man the cost $$$$ |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 6784 |
I've had Circuit Python on a RP2040-Zero acting as a simple game controller and simulating key presses to a PC. It works nicely - just like a USB keyboard. IIRC you can send strings as well as characters. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
Quazee137 Guru Joined: 07/08/2016 Location: United StatesPosts: 570 |
My neighbor found this pico host and device Now I need to try and follow what he is doing. Tools, library's ect . . . ATM way more than I currently understand. But goal post is somewhat in sight. Adding an SD card to store the key to macro conversions and maybe a display to show what was just sent. Neighbor is still playing with circuitpython things he also found on youtube. I am also playing with dotool and linux keyboard custom shortcuts. Oddly I can do dotool sleep 0.3 type "text" assigned to alt s just haven't figured out how to have it do an enter key. Collecting a lot of different key representations. Looking for simple but complete along with mouse and game controllers. Have FUN ALL as I sure am. Quazee137 side note I had a fall on the 30th of last month resulting in my right shoulder being dislocated along with three bruised ribs. Went to ER then two days later saw Doc and I see him again on the 16th. I have lived with pain from my scoliosis but his hurt so much more. I think I had time to grow use to my old every day pain. Edited 2024-04-15 21:15 by Quazee137 |
||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4226 |
Hi Quazee, I hope your pain quickly vanishes. Good find. When Peter sees this, he may change his CMM1.5 platform to omit the CH340 UART-USB. That will be CMM-1.666 then. Although, it will use the last PIO (the other one is used for VGA).... Volhout PicomiteVGA PETSCII ROBOTS |
||||
Quazee137 Guru Joined: 07/08/2016 Location: United StatesPosts: 570 |
A 2nd RP2040 may even be cheaper and a more customizable use as Peter knows the magic C these like. Quazee137 |
||||
Print this page |