Fieldnotes from the USB support system built into Annex32 version 1.51.8.

All about the VGA for the ESP32-S3
User avatar
cicciocb
Site Admin
Posts: 2059
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 439 times
Been thanked: 1358 times
Contact:

Re: Fieldnotes from the USB support system built into Annex32 version 1.51.8.

Post by cicciocb »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Fri Dec 29, 2023 1:12 pm Guuuuaaaauuuuu!!!!

IMG_20231229_140925.jpg
As you can see, the mouse and the keyboards work well :D
User avatar
Electroguard
Posts: 860
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 276 times
Been thanked: 323 times

Re: Fieldnotes from the USB support system built into Annex32 version 1.51.8.

Post by Electroguard »

I hope the USB will work on these purple n16r8 UNO clones, cos I can't find any solder bridge options.
But I don't even have a vga interface done for it yet.
Oh dammit Fernando, you're supposed to be creating pcb's, not rushing me into changing the order of my todo list priorities.
Thanks for the feedback, BTW.
Can't wait to create VGA menu's and options selection and multiple pages, USB is gonna be a game changer.

Francesco, have you used the USB input for anything other than a VGA display... like as an alternative to physical or web button selection ?
User avatar
cicciocb
Site Admin
Posts: 2059
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 439 times
Been thanked: 1358 times
Contact:

Re: Fieldnotes from the USB support system built into Annex32 version 1.51.8.

Post by cicciocb »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Fri Dec 29, 2023 1:41 pm I hope the USB will work on these purple n16r8 UNO clones, cos I can't find any solder bridge options.
But I don't even have a vga interface done for it yet.
Oh dammit Fernando, you're supposed to be creating pcb's, not rushing me into changing the order of my todo list priorities.
Thanks for the feedback, BTW.
Can't wait to create VGA menu's and options selection and multiple pages, USB is gonna be a game changer.

Francesco, have you used the USB input for anything other than a VGA display... like as an alternative to physical or web button selection ?
Sure, as you can see in the demo code provided in the help , the USB can be used independently from the VGA
User avatar
Fernando Perez
Posts: 378
Joined: Mon Feb 15, 2021 10:09 pm
Location: Santander (Spain)
Has thanked: 195 times
Been thanked: 267 times

Re: Fieldnotes from the USB support system built into Annex32 version 1.51.8.

Post by Fernando Perez »

I did this with you in mind, Robin:
If Cicciocb has made me temporarily abandon my projects, dazzled by the long-awaited USB system, I told myself, let's do the same with Electroguard.
:lol:

Good, and now we will have to focus on the end-of-year holidays and the family.
Happy New Year to everyone!
User avatar
Electroguard
Posts: 860
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 276 times
Been thanked: 323 times

Re: Fieldnotes from the USB support system built into Annex32 version 1.51.8.

Post by Electroguard »

Thanks Fernando, can't wish you the same just yet... Margaret was told off for wishing someone happy new year earlier today cos evidently it is considered bad luck in France to say it before the new year (but I can still think it).


Hey, I have have a VGA KVM switch on my desktop computer which lets me switch the monitor between the computer and Annex-s3 (Weather server).
But the KVM can also switch USB keyboard and mouse... so I am eager to find out if it might be possible to switch vga monitor plus usb k/b and/or mouse between the computer and Annex-S3.


Can't get up in the workshop to do any soldering yet, cos got 2 orphaned kittens in the hanger that have 'imprinted' on me and cry until I let them in the control room with me, then play havoc with the mess of dangling wires everywhere - so basically I am kept out of my workshop by 2 lovable little kittens.
User avatar
Electroguard
Posts: 860
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 276 times
Been thanked: 323 times

Re: Fieldnotes from the USB support system built into Annex32 version 1.51.8.

Post by Electroguard »

Had to suffer the antics of 2 hooligan kittens while soldering jumpers on the n16r8's, but so glad I did... cos the USB feature is a game changer.
Was an initial scare when it didn't work, but was to due to the USB C adapter being only a charger adapter without any data lines.
It was also too wide to fit comfortably next to the other USB port anyway, so I swapped it for a thinner cable type adapter which works great.

Not even tried it with VGA yet, simply modified Francesco's example (below) to show 1 sec mouse movements and keyboard presses in the wlog window.
Next step will be to knock up a web page with various textbox$'s to show updated mouse movements, button presses, and k/b codes.
So a big take-away from my first brief tests is that the USB can be used to navigate and select even without any display device attached.

I took advantage of an Ali haloween sale to buy several different wifi mice and k/b's while they were dirt cheap, and although I have only tried a couple of items, it was a pleasant surprise to discover an Air Mouse with adjustable levels of sensitivity which really does provide effective mouse co-ordinates when waved around, plus the added bonus of including an IR Learning Remote control... all for 2 euros with free shipping.

Still got 6 more items to try - so thanks for the 'heads up' about that haloween sale Francesco, and thanks for adding another brilliant Annex feature.

Code: [Local Link Removed for Guests]

usb.setup 640, 480
onMouseMove Mouse_Move
onMouseClick Mouse_Click
onKeyboard Keyboard_Press
onGamePad Gamepad_Change
wlog "waiting..."
wait

Mouse_Move:
print "mouse move", mouseX, mouseY, mouseZ
wlog "mouse move", mouseX, mouseY, mouseZ
pause 1000
return

Mouse_Click:
print "mouse click", mouseX, mouseY, mouseZ
wlog "mouse click", mouseX, mouseY, mouseZ
return

Keyboard_Press:
print "keyboard", kbdcode
wlog "keyboard", kbdcode
return

Gamepad_Change:
print "Gamepad", gamepadcodes(1), gamepadcodes(2), gamepadcodes(3), gamepadcodes(4), gamepadcodes(5), gamepadcodes(6)
wlog "Gamepad", gamepadcodes(1), gamepadcodes(2), gamepadcodes(3), gamepadcodes(4), gamepadcodes(5), gamepadcodes(6)
return
User avatar
Electroguard
Posts: 860
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 276 times
Been thanked: 323 times

Re: Fieldnotes from the USB support system built into Annex32 version 1.51.8.

Post by Electroguard »

Here's wishing everyone a Happy New Year, and offering a simple web page for testing USB output.
I've been using it on a bare bones S3 (not even any headers) for checking out several wifi air mice and keyboards.

Code: [Local Link Removed for Guests]

'Simple web page for testing USB output, also defaults to wlog for easy confirmation of wifi pairing.
dbug=1       '1=send usb output to wlog, 0=turn off wlog (can also be controlled by webpage checkbox.  
xres=640: yres=480
usb.setup xres, yres    'also sets the webpage meter maximums
kbdcode=0
gosub web
onhtmlreload web
onMouseMove Mouse_Move
onMouseClick Mouse_Click
onKeyboard Keyboard_Press
onGamePad Gamepad_Change
wlog "waiting..."
wait


web:
cls
autorefresh 250
a$=""
a$=a$ + |<br><div style='display: table; margin-right:auto;margin-left:auto;text-align:center;font-size: 80%;'>|
a$=a$ + |Mouse X | + textbox$(mousex,"mousewin") 
a$=a$ + |<br><br>|
a$=a$ + meter$(mousex,0,xres,"mousemwin") 
a$=a$ + |<br><br>|
a$=a$ + |Mouse Y | + textbox$(mousey,"mousewin") 
a$=a$ + |<br><br>|
a$=a$ + meter$(mousey,0,yres,"mousemwin") 
a$=a$ + |<br><br><br>|
a$=a$ + |Mouse Z | + textbox$(mousez,"mousewin") 
a$=a$ + |<br><br><br>|
a$=a$ + cssid$("mousewin", "width:40; height:24; text-align:center; background:GhostWhite;color:darkblue;")
a$=a$ + cssid$("mousemwin", "width:400; height:24; text-align:center; background:GhostWhite;color:darkblue;")
a$=a$ + |Keyboard | + textbox$(kbdcode,"kbwin") 
a$=a$ + cssid$("kbwin", "width:40; height:24; text-align:center; background:GhostWhite;color:darkred;")
a$=a$ + |<br><br><br>|
a$=a$ + |wlog (Dbug) | + checkbox$(dbug) 
a$=a$ + |<br><br>|
html a$: a$=""
return

Mouse_Move:
print "mouse move", mouseX, mouseY, mouseZ
if dbug then 
 wlog "mouse move", mouseX, mouseY, mouseZ 
 pause 1000
endif
return

Mouse_Click:
print "mouse click", mouseX, mouseY, mouseZ
if dbug then wlog "mouse click", mouseX, mouseY, mouseZ
return

Keyboard_Press:
print "keyboard", kbdcode
if dbug then wlog "keyboard", kbdcode
return

Gamepad_Change:
print "Gamepad", gamepadcodes(1), gamepadcodes(2), gamepadcodes(3), gamepadcodes(4), gamepadcodes(5), gamepadcodes(6)
if dbug then wlog "Gamepad", gamepadcodes(1), gamepadcodes(2), gamepadcodes(3), gamepadcodes(4), gamepadcodes(5), gamepadcodes(6)
return
User avatar
Electroguard
Posts: 860
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 276 times
Been thanked: 323 times

Re: Fieldnotes from the USB support system built into Annex32 version 1.51.8.

Post by Electroguard »

Francesco, I bought the same 3 devices you mentioned at the beginning of this thread, but neither the air mouse or ps controller came with a wifi dongle, did yours ?
Too late now anyway - I have not been able to pair them with a wifi dongle from a different device, so I suppose they will go on the scrap heap.
Still got various other cheap air mice that did have wifi dongles and do all work, so not complaining.
And the dual analog wifi joystick controller is such a 'must have' that I'll just order another one (or two for a tenner) anyway... https://www.aliexpress.com/item/1005005 ... pQNLof1eb8
User avatar
cicciocb
Site Admin
Posts: 2059
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 439 times
Been thanked: 1358 times
Contact:

Re: Fieldnotes from the USB support system built into Annex32 version 1.51.8.

Post by cicciocb »

Hi Robin, first of all I wish you an happy new year for you and Margaret.

Yes, all my devices have the usb dongle and all work well, including the usb mouse with accelerometers that remember the controller of the Wii.
Post Reply