USB Keyboard, Mouse and Joystick Support

All about the VGA for the ESP32-S3
Post Reply
User avatar
cicciocb
Site Admin
Posts: 1843
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 399 times
Been thanked: 1232 times
Contact:

USB Keyboard, Mouse and Joystick Support

Post by cicciocb »

Hi all,
I have almost finished writing the code to integrate support for USB devices connected to Annex32 for the ESP32-S3.

I was able to connect USB keyboard, USB mouse and USB joystick (game controller).

I tested several 'classic' wired keyboards and mice, but I found it much more practical to use USB wireless devices that are generally delivered with a small dongle to be installed in the USB port.

I tested 2 (keyboard/mouse) devices and one Game Controller

Device 1
image.png

Device 2 : this one I tested in 2 versions, with and without backlight
image.png

Device 3
image.png
I am truly surprised at how well they work and how recognition happens automatically when connecting and disconnecting devices from the USB port of the ESP32-S3.

I was also surprised by how well the 'Device 1' works, which is internally based on accelerometers/gyroscopes. Considering that all these devices were purchased at a truly low cost (ranging between 2 and 4 €), I think they can be ideal companions for Annex32-S3.

I uploaded a little video just to show how it work :


So, stay tuned ......
You do not have the required permissions to view the files attached to this post.
User avatar
Electroguard
Posts: 830
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 263 times
Been thanked: 313 times

Re: USB Kayboard, Mouse and Joystick Support

Post by Electroguard »

FANTASTIC !
And even the PS game controller.
I am so glad I splurged out on all of those devices,
That makes Space Invaders quite a real possibility.

I also ordered 2 of the UNO S3 N16R8 clones plus a couple of UNO proto-shields, which should make an ideal platform for mounting VGA resistors.

Very, very well done sir, and huge thanks.
User avatar
Electroguard
Posts: 830
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 263 times
Been thanked: 313 times

Re: USB Kayboard, Mouse and Joystick Support

Post by Electroguard »

I was interested enough to watch the video demo multiple times, Francesco.
Were you using the TFT touchscreen for its touch capabilities, or its SD storage (and you may even have also had a separate SD reader attached).
So were you running Annex running from S3 or SD ? ... or perhaps running on S3 while also reading SD ?
Is plug-in USB control add-ons limited to being run on S3 devices ?

From what I can gather from that Dronebot Workshop article of a few months ago, the more expensive PS controllers also have giros and accelerometers built in to them, like you found on the air-mouse keyboard 'thingy'.
So in theory it may be possible to wave your 'thingy' in the air to navigate VGA page menu's etc (or get arrested).
Looks like your test screen may be able to discover a devices capabilities.

I got some cheapo VGA2AV and AV2VGA converters during the Trick or Treat sale, so now I can get a couple of cheap 7" AV monitors for use with S3 VGA.
User avatar
cicciocb
Site Admin
Posts: 1843
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 399 times
Been thanked: 1232 times
Contact:

Re: USB Kayboard, Mouse and Joystick Support

Post by cicciocb »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Mon Nov 13, 2023 11:15 am I was interested enough to watch the video demo multiple times, Francesco.
Were you using the TFT touchscreen for its touch capabilities, or its SD storage (and you may even have also had a separate SD reader attached).
So were you running Annex running from S3 or SD ? ... or perhaps running on S3 while also reading SD ?
Is plug-in USB control add-ons limited to being run on S3 devices ?

From what I can gather from that Dronebot Workshop article of a few months ago, the more expensive PS controllers also have giros and accelerometers built in to them, like you found on the air-mouse keyboard 'thingy'.
So in theory it may be possible to wave your 'thingy' in the air to navigate VGA page menu's etc (or get arrested).
Looks like your test screen may be able to discover a devices capabilities.

I got some cheapo VGA2AV and AV2VGA converters during the Trick or Treat sale, so now I can get a couple of cheap 7" AV monitors for use with S3 VGA.
The USB works only on -S3 devices (because it has a native USB interface) and the -S3 can work with TFT, SD and VGA at the same time.
In my config I also have a I2C oled connected, just for testing purposes.

As I already said in a previous discussion, the PS3 controllers use Bluetooth whilst the cheap controller I found use USB through a wireless connection.
User avatar
Electroguard
Posts: 830
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 263 times
Been thanked: 313 times

Re: USB Kayboard, Mouse and Joystick Support

Post by Electroguard »

Just to point out for those who may not know..
Many AliExpress items state free shipping on orders over 10 euros, which seems like the sellers way to tempt you into buying more from them to avoid the shipping costs.
But my experience is that the deal is valid for all items bought from different sellers who offer that same 'free shipping over 10 euros' offer, if the items are all bought in the same 'shopping cart' and paid for at the same time

So we wait till we have a few items from different sellers which totals more than 10 euros, then order them all at the same time.
The collective shipping charges are shown in the shopping cart when ordering the items, so it is easy enough to bail out before buying if not happy.
It seems the different chinese sellers are just proxy sales agents anyway, cos we might order a dozen items from a dozen different sellers and usually everything that was ordered together gets delivered on the same day in the same package, so there is evidently some form of collective oversight of purchases from different sellers.

Buying any one item shown below would incur about 2 euros shipping costs which could make me think twice about buying it, especially if I wanted 2 different items which would cost me about 4 euros for shipping.
But buying any 2 of those items at the same time (even though from different sellers) would give 'free shipping over 10 euros' and save about 4 euros.

all.jpg

The one thing we do watch out for is when changing the quantity of an item, cos that's when a few sellers try to catch out the unwary
Eg: if choosing more than 1 of a free shipping item, they may bang on a high extra shipping cost if more are ordered, and hope it goes unnoticed.
So we would beat them at their own game by just ordering 1 item per day with free shipping, but for several days... they will end up paying a lot more for their shipping.

It can also work the other way with decent sellers, cos they might charge peanuts for an item but a couple of quid for shipping, which might be cause to hesitate. But quite often adding multiple items which only costs peanuts may hardly affect the overall shipping cost, making it much more attractive.
You do not have the required permissions to view the files attached to this post.
Post Reply