tsc_fourWireModePolling
Overview
The fourWireModePolling example shows how to use TSC driver in 4-wire polling(auto-measure) modes: The touch screen controller needs to co-work with ADC and TSC analogue.
In this example , we make use of the available electrodes on board to show driver usage.
Firstly, before TSC starts work, ADC driver configure ADC_HCx;
Then, we configure TSC module to work in auto-measure mode.
Then, we start screen detection and the TSC automatically measures coordinates after detect a touch;
Then, we judge whether the measure data is valid in main function.
Lastly, if measure data is valid, serial terminal prints x/y-coordinate information.
Running the demo
When running successfully, the log output in terminal shall be similar as below:
TSC fourWireModePolling Example Start! ADC_5HC_DoAutoCalibration() Done. Please touch screen. x = 3741, y = 1068 x = 3741, y = 572 x = 3746, y = 517 x = 3745, y = 518 x = 3751, y = 508 x = 3752, y = 512 x = 3750, y = 507 …