GLCD Touch Screen Example - Keypad 4D uLCD-32PTU
Posted: Mon Jul 11, 2022 12:17 pm
Just sharing a basic working example of the using the Touch Screen of the 4D Systems uLCD 32PTU as a Keypad for inputing user data.
I needed to allow the user to input some values, this example is visually pretty crude but works well in hardware. Not all keys are enabled and I currently only use it for Positive integers but its a starting point for anyone interested in using the touch screen.
Each key press builds a text string, this is converted to a number.
'OK' return this numeric value to the main loop. 'Exit' returns 0.
Known issues.
* # . key do nothing at this time.
There is no sign key '-' as I did not need one.
Uses the gLCD_4D_v2_Picaso1 component so the 4D screen is run as a serial device (Not running a VIS-GINIE program )
If you simulate the Baud rate of the component reverts to 4800 and need changing back to the hardware Baud rate of your screen.
I needed to use the 4D software to revert my uLCD to serial mode and changed the Baud rate to 19200.
I disabled the HighSpeed as this did not work in my example but I did not look the issue in any detail. Cheers, J.
I needed to allow the user to input some values, this example is visually pretty crude but works well in hardware. Not all keys are enabled and I currently only use it for Positive integers but its a starting point for anyone interested in using the touch screen.
Each key press builds a text string, this is converted to a number.
'OK' return this numeric value to the main loop. 'Exit' returns 0.
Known issues.
* # . key do nothing at this time.
There is no sign key '-' as I did not need one.
Uses the gLCD_4D_v2_Picaso1 component so the 4D screen is run as a serial device (Not running a VIS-GINIE program )
If you simulate the Baud rate of the component reverts to 4800 and need changing back to the hardware Baud rate of your screen.
I needed to use the 4D software to revert my uLCD to serial mode and changed the Baud rate to 19200.
I disabled the HighSpeed as this did not work in my example but I did not look the issue in any detail. Cheers, J.