Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 20:36 25 Nov 2024 Privacy Policy
Jump to

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 States
Posts: 570
Posted: 08:42am 09 Apr 2024
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 9111
Posted: 08:59am 09 Apr 2024
Copy link to clipboard 
Print this post

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: Australia
Posts: 2914
Posted: 09:26am 09 Apr 2024
Copy link to clipboard 
Print this post

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: Australia
Posts: 2914
Posted: 09:30am 09 Apr 2024
Copy link to clipboard 
Print this post

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 States
Posts: 570
Posted: 10:03am 09 Apr 2024
Copy link to clipboard 
Print this post

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: Netherlands
Posts: 4226
Posted: 11:18am 09 Apr 2024
Copy link to clipboard 
Print this post

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 States
Posts: 570
Posted: 12:33pm 09 Apr 2024
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 6784
Posted: 01:06pm 09 Apr 2024
Copy link to clipboard 
Print this post

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: Canada
Posts: 83
Posted: 01:01am 11 Apr 2024
Copy link to clipboard 
Print this post

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 States
Posts: 570
Posted: 03:31am 11 Apr 2024
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 6784
Posted: 07:15am 11 Apr 2024
Copy link to clipboard 
Print this post

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 States
Posts: 570
Posted: 11:07am 15 Apr 2024
Copy link to clipboard 
Print this post

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: Netherlands
Posts: 4226
Posted: 12:09pm 15 Apr 2024
Copy link to clipboard 
Print this post

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 States
Posts: 570
Posted: 07:16pm 15 Apr 2024
Copy link to clipboard 
Print this post

  Volhout said  

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


 A 2nd RP2040 may even be cheaper and a more customizable use as
Peter knows the magic C these like.  


Quazee137
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024