![]() |
Forum Index : Microcontroller and PC projects : Simulating a touch panel
Author | Message | ||||
fred777 Regular Member ![]() Joined: 01/07/2021 Location: United KingdomPosts: 57 |
Hi all, I have a ssd1963 based display without touch support. I would like to simulate touch events using a trackball. The trackball works like a ps/2 mouse and is handled by an avr microcontroller that decodes the ps/2 data. I don’t think I can read the trackball from the picomite. It might be possible to let the avr act like a touch controller (XPT2046?) but that would be a lot of work. I’d rather just have the avr generate an interrupt for the picomite to have it fetch the mouse coordinates from the avr and then simulate a touch event. Is there a way to simulate a touch event? Cheers, Fred |
||||
Turbo46![]() Guru ![]() Joined: 24/12/2017 Location: AustraliaPosts: 1642 |
Somebody has done that with a mouse but I can't find the post. You can do it with a serial mouse or one of the USB to serial mouse converters. It has been done on the CMM1 a couple of times. Don't now about trackballs. Bill Keep safe. Live long and prosper. |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7937 |
I don't think the PicoMite can handle the streams of interrupts you get from a mouse or trackball - not if you are trying to update a pointer on the screen at the same time anyway. The CMM is a different beast. Edited 2022-11-09 07:39 by Mixtel90 Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
Turbo46![]() Guru ![]() Joined: 24/12/2017 Location: AustraliaPosts: 1642 |
Here it is! It was done by VegiPete. The CMM1 is indeed a different device, it's a lot slower that the Picomite at 80MHz there are posts here and here. TassyJim has done something with an arduino also. Bill Keep safe. Live long and prosper. |
||||
fred777 Regular Member ![]() Joined: 01/07/2021 Location: United KingdomPosts: 57 |
Thanks for those suggestions but I was also looking for a way to fake touch events. The idea is to use the Trackball with MMBasic's Gui controls. So a routine to simulate pressing the lcd panel would be needed. (TOUCH FAKE X,Y or something like that... ;-) ) |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10315 |
Can't be done unless you emulate the XPT2046 |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
With a touch panel, you 'click' where you touch. With a mouse, you need a cursor to know where you are going to click. Without some sort of visual indication of where the mouse is, life would be difficult. PS2 to serial with an Arduino nano is easy. Serial interrupts in MMBasic is easy. It is then up to you to track the mouse movements and organize a mouse cursor for your program. If you want to control programs similar to joysticks, no cursor is needed, just the serial interrupt routines. Jim VK7JH MMedit |
||||
fred777 Regular Member ![]() Joined: 01/07/2021 Location: United KingdomPosts: 57 |
I was planning on drawing a crosshair as a cursor. But let’s forget about the whole trackball thing for a moment. Is there any way to trigger a gui control from basic, if only for testing purposes? |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10315 |
No: gui controls are tightly bound to touch |
||||
fred777 Regular Member ![]() Joined: 01/07/2021 Location: United KingdomPosts: 57 |
Ok, thanks for the information. I guess I’ll just use the avr to read the trackball and drive the ssd1963. Cheers, Fred |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7937 |
Could you display your own version of the controls as an image on the screen then move a cursor sprite over it and read the x,y position on a click interrupt? It's rather simplified in some ways though. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10315 |
Have a look at the various backpack projects on Geoff's site. Lots of examples of GUIs without using the GUI command using straight Basic |
||||
Turbo46![]() Guru ![]() Joined: 24/12/2017 Location: AustraliaPosts: 1642 |
See Geoff's Getting Started with the Micromite document. It explains how to do it quite well and gives a program listing. The MX170 Micromite does not have GUI functions so they must be done in MMBasic. If you check out my link above, that's how I do it, I pinched his code. ![]() ![]() Bill Keep safe. Live long and prosper. |
||||
fred777 Regular Member ![]() Joined: 01/07/2021 Location: United KingdomPosts: 57 |
Thanks I’ll have a look at those examples Edited 2022-11-10 03:05 by fred777 |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |