Adding a touchscreen "like" experience  - Page 1
Forum section: electronics / general

author: rthorntn
author_rank: Frequent Contributor
timestamp: August 04, 2024, 12:08:12 am
content: Hi,I have a nice 13.3" ePaper monitor (Dasung Paperlike Pro) that I want to connect to an RPi and wall mount to use in home automation but I would need a way to input.So it's not a mouse like experience more like an intuitive button like experience.For example say I set it up to display 16 information tiles (4x4) I'd like to be able to quickly select a tile to get expanded information, again tiled, and I'd also like a quick way of setting a tile. I click on say tile 4 (living room), then on the next page, tile 2 (aircon), on this page I guess there are tiles for on/off, mode & temperature, so I should be able to set those things quickly and intuitively.It would need a way to go back a page.So how would you approach it, it would have to be small and discrete, I'll probably embed the control mechanism into the monitor case?Thanks!

author: themadhippy
author_rank: Super Contributor
timestamp: August 04, 2024, 12:26:28 am
content: hows about a touch overlay for your screen

author: rthorntn
author_rank: Frequent Contributor
timestamp: August 04, 2024, 12:47:07 am
content: Any idea if there are overlays that work well and don't cost the earth, it's a 13.3" 4:3 which wont help.

author: NiHaoMike
author_rank: Super Contributor
timestamp: August 04, 2024, 02:33:49 am
content: A small array of IR LEDs and photodiodes along the edges would be fairly easy to implement.

author: rthorntn
author_rank: Frequent Contributor
timestamp: August 04, 2024, 04:18:03 am
content: Thanks.So lets say I go for 12 square tiles (4:3).And so I have strips, say 12 IR LED/photodiode pairs top to bottom and 16 IR LED/photodiode pairs left to right spaced so there are 16 intersecting points in each tile. Then I have logic that calls it a press when at least one horizontal and one vertical beam is broken over that tile?

author: pcprogrammer
author_rank: Super Contributor
timestamp: August 04, 2024, 06:17:23 am
content: Quote from: rthorntn on August 04, 2024, 04:18:03 amThat is the idea. Easily done with a micro processor. To reduce on GPIO pins you can make it a scanning matrix. Either with the use of multiplexers and de-multiplexers or by turning the LED/photodiodes on and off.

author: Psi
author_rank: Super Contributor
timestamp: August 04, 2024, 08:21:52 am
content: Quote from: rthorntn on August 04, 2024, 12:47:07 amThis one might work. but i'm not sure what you consider expensive.I'd expect you'd spend more than this in time getting an IR system to work.https://www.aliexpress.com/item/32809361607.html?spm=a2g0o.detail.1000023.1.d60cvgA7vgA7pp

author: MarkF
author_rank: Super Contributor
timestamp: August 04, 2024, 11:12:13 am
content: I did something similar to implement a video switch.By using a touch screen and grabbing the touch release location (or mouse button-up location), you can then do a search over all your tiles of any size(s) to determine which tile was selected.I just scanned over an array of tile xy center locations and width and heights:Code:bool isWithin(int xCenter, int yCenter, int width, int height, int cursorX, int cursorY){int w2 = width / 2;int h2 = height / 2;if ( (cursorX > (xCenter - w2)) && (cursorX < (xCenter + w2)) &&(cursorY > (yCenter - h2)) && (cursorY < (yCenter + h2)) ) return(true);return(false);}You also use the same array to draw the tiles on the screen.Really pretty painless and easy to change your layout to any size and shape.Note: The box on the right side with a wide boarder was used to indicate power on/off.The user would select a box in the middle (i.e. video source) and then select a box on the right (i.e. monitor) to map the video. The highlighted boxes show the selection/connection.