{"id":4363,"date":"2026-04-15T09:01:08","date_gmt":"2026-04-15T09:01:08","guid":{"rendered":"https:\/\/blog.embeddedexpert.io\/?p=4363"},"modified":"2026-04-15T09:05:16","modified_gmt":"2026-04-15T09:05:16","slug":"stm32f429-discovery-display-guide-part-5-read-touch-data","status":"publish","type":"post","link":"https:\/\/blog.embeddedexpert.io\/?p=4363","title":{"rendered":"STM32F429 Discovery Display Guide \u2013 Part 5: Read Touch Data"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"559\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_6djb3t6djb3t6djb-1-1024x559.png\" alt=\"\" class=\"wp-image-4364\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_6djb3t6djb3t6djb-1-1024x559.png 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_6djb3t6djb3t6djb-1-300x164.png 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_6djb3t6djb3t6djb-1-768x419.png 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_6djb3t6djb3t6djb-1-1150x627.png 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_6djb3t6djb3t6djb-1-750x409.png 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_6djb3t6djb3t6djb-1-400x218.png 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_6djb3t6djb3t6djb-1-250x136.png 250w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_6djb3t6djb3t6djb-1.png 1408w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>In Part 5, we transition from hardware configuration to data acquisition by implementing the logic required to extract precise X and Y coordinates from the STMPE811. We will explore how to poll the internal FIFO buffer and convert raw analog readings into meaningful screen positions for your user interface.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>In this guide, we shall cover the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Header file modification.<\/li>\n\n\n\n<li>Source file modification.<\/li>\n\n\n\n<li>Main code.<\/li>\n\n\n\n<li>Results.<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Header File Modification:<\/h2>\n\n\n\n<p>Open STMPE811.h header file and add the following the define statements as follows:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">#define Touch_XMIN \t\t\t\t\t\t390\n#define Touch_YMIN \t\t\t\t\t\t359\n#define Touch_XMAX \t\t\t\t\t\t3830\n#define Touch_YMAX \t\t\t\t\t\t3895\n#define Touch_WIDTH \t\t\t\t\t(Touch_XMAX - Touch_XMIN)\n#define Touch_HEIGHT \t\t\t\t\t(Touch_YMAX - Touch_YMIN)<\/pre><\/div>\n\n\n\n<p>The Touch minimum and maximum values has been obtained without mapping the coordinates. This will be discussed in the source part of this guide.<\/p>\n\n\n\n<p>Next, declare the following function:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">TouchDetect_t isTouched(void);<\/pre><\/div>\n\n\n\n<p>This function will return 1 (Touched) when there is touch presented.<\/p>\n\n\n\n<p>Next, declare the function that will read the touch values as follows:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">void getTouchValue(uint16_t *X, uint16_t *Y);<\/pre><\/div>\n\n\n\n<p>This function retrieves the current 12-bit touch coordinates by reading the STMPE811 FIFO via I2C and storing the resulting X and Y values into the provided memory addresses.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Thats all for the header file.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. Source File Modification:<\/h2>\n\n\n\n<p>Open STMPE811.c source file.<\/p>\n\n\n\n<p>After the declaration of read\/write functions helper function, declare the following function:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">static uint16_t map(uint16_t x, uint16_t in_min, uint16_t in_max, uint16_t out_min, uint16_t out_max)\n{\n\t  return (x - in_min) * (out_max - out_min + 1) \/ (in_max - in_min + 1) + out_min;\n}<\/pre><\/div>\n\n\n\n<p>This function shall map the raw touch data to represent the area being touched on the display.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Next, the <strong>isTouched<\/strong> function:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">ouchDetect_t isTouched(void)\n{\n    uint8_t value = 0;\n\n    STMPE811_ReadReg(STMPE811_REG_TSC_CTRL, &amp;value);\n\n    value &amp;= STMPE811_TS_CTRL_STATUS;\n\n    if(value == STMPE811_TS_CTRL_STATUS)\n    {\n        STMPE811_ReadReg(STMPE811_REG_FIFO_SIZE, &amp;value);\n\n        if(value &gt; 0)\n        {\n            return touched;\n        }\n    }\n    else\n    {\n        \/* Reset FIFO *\/\n        STMPE811_WriteReg(STMPE811_REG_FIFO_STA, 0x01);\n        STMPE811_WriteReg(STMPE811_REG_FIFO_STA, 0x00);\n    }\n\n    return no_touch;\n}<\/pre><\/div>\n\n\n\n<p>This function checks the hardware status to determine if a valid touch event is currently occurring by verifying two conditions: first, it checks the&nbsp;<strong>TSC_CTRL<\/strong>&nbsp;register to see if the touch screen controller detects physical pressure, and second, it confirms that the&nbsp;<strong>FIFO buffer<\/strong>&nbsp;actually contains coordinate data. If the screen is not being touched, the function proactively clears the FIFO to flush any stale or &#8220;ghost&#8221; data, ensuring that only fresh, real-time interactions are reported as a&nbsp;<code>touched<\/code>&nbsp;state.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"559\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_v0q77gv0q77gv0q7-1024x559.png\" alt=\"\" class=\"wp-image-4365\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_v0q77gv0q77gv0q7-1024x559.png 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_v0q77gv0q77gv0q7-300x164.png 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_v0q77gv0q77gv0q7-768x419.png 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_v0q77gv0q77gv0q7-1150x627.png 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_v0q77gv0q77gv0q7-750x409.png 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_v0q77gv0q77gv0q7-400x218.png 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_v0q77gv0q77gv0q7-250x136.png 250w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_v0q77gv0q77gv0q7.png 1408w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Next, <strong>getTouchValue<\/strong> function:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">void getTouchValue(uint16_t *X, uint16_t *Y)\n{\n    uint32_t uldataXYZ;\n    uint8_t dataXYZ[4];\n\n    uint16_t x,y;\n\n    STMPE811_ReadMulti(STMPE811_REG_TSC_DATA_NON_INC, dataXYZ, 4);\n\n    \/* Combine data *\/\n    uldataXYZ = (dataXYZ[0] &lt;&lt; 24) |\n                (dataXYZ[1] &lt;&lt; 16) |\n                (dataXYZ[2] &lt;&lt; 8)  |\n                (dataXYZ[3]);\n\n    x = (uldataXYZ &gt;&gt; 20) &amp; 0x0FFF;\n    y = (uldataXYZ &gt;&gt; 8)  &amp; 0x0FFF;\n\n    \/* Reset FIFO *\/\n    STMPE811_WriteReg(STMPE811_REG_FIFO_STA, 0x01);\n\n    \/* Re-enable FIFO *\/\n    STMPE811_WriteReg(STMPE811_REG_FIFO_STA, 0x00);\n\n    *X=map(x,Touch_XMIN,Touch_XMAX,0,240);\n    *Y=map(y,Touch_YMIN,Touch_YMAX,0,320);\n\n}<\/pre><\/div>\n\n\n\n<p>This function extracts and calibrates raw touch data from the STMPE811 by reading a 4-byte burst from the FIFO, which contains the packed X and Y coordinates.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Key Operations<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Bit Manipulation:<\/strong>&nbsp;It reassembles the four bytes into a 32-bit variable (<code>uldataXYZ<\/code>) and uses bit-shifting to isolate the two&nbsp;<strong>12-bit values<\/strong>&nbsp;(0\u20134095 resolution) representing the raw X and Y positions.<\/li>\n\n\n\n<li><strong>FIFO Maintenance:<\/strong>&nbsp;The function toggles the&nbsp;<code>FIFO_STA<\/code>&nbsp;register to flush the buffer after the read, ensuring subsequent calls retrieve real-time data rather than historical samples.<\/li>\n\n\n\n<li><strong>Linear Mapping:<\/strong>&nbsp;Finally, it uses a&nbsp;<code>map()<\/code>&nbsp;function to convert the raw analog values into pixel coordinates (0\u2013240 for width, 0\u2013320 for height) based on pre-defined calibration constants (<code>XMIN\/XMAX<\/code>).<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"559\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_w21344w21344w213-1024x559.png\" alt=\"\" class=\"wp-image-4366\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_w21344w21344w213-1024x559.png 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_w21344w21344w213-300x164.png 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_w21344w21344w213-768x419.png 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_w21344w21344w213-1150x627.png 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_w21344w21344w213-750x409.png 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_w21344w21344w213-400x218.png 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_w21344w21344w213-250x136.png 250w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Gemini_Generated_Image_w21344w21344w213.png 1408w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Note: To get the maximum and minimum touch values, just need to add the following to the end of the function as follows:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">*X=x;\n*Y=y;<\/pre><\/div>\n\n\n\n<p>Please note that you need to comment\/delete the function once you get the minimum and maximum values for the touch.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>That all for the source file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. Main Function:<\/h2>\n\n\n\n<p>Open main.c file.<\/p>\n\n\n\n<p>In user code begin PV, declare the following variable:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">uint16_t touchState=0;<\/pre><\/div>\n\n\n\n<p>This will indicate if the screen has been touched or not.<\/p>\n\n\n\n<p>Next, declare the following variables:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">uint16_t xTouch,yTouch;<\/pre><\/div>\n\n\n\n<p>These will hold the touch values.<\/p>\n\n\n\n<p>Next, in while 1 loop:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">touchState=isTouched();\nif(touchState==touched)\n{\n  getTouchValue(&amp;xTouch,&amp;yTouch);\n\n}\n\n\nHAL_Delay(50);<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Logic Execution Flow<\/h3>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>Detection Polling:<\/strong>&nbsp;The code first calls&nbsp;<code>isTouched()<\/code>, which performs the low-level register checks to see if the resistive panel is physically compressed and if the FIFO contains data.<\/li>\n\n\n\n<li><strong>Conditional Execution:<\/strong>&nbsp;Only if a valid touch is confirmed (<code>touchState == touched<\/code>) does the program proceed to call&nbsp;<code>getTouchValue()<\/code>. This prevents the CPU from performing unnecessary I2C burst reads or coordinate math when the screen is idle.<\/li>\n\n\n\n<li><strong>Data Extraction:<\/strong>&nbsp;Within the&nbsp;<code>if<\/code>&nbsp;block, the raw 12-bit data is fetched, the FIFO is cleared, and the results are mapped to your&nbsp;<strong>240&#215;320<\/strong>&nbsp;pixel grid, storing them in the variables&nbsp;<code>xTouch<\/code>&nbsp;and&nbsp;<code>yTouch<\/code>.<\/li>\n\n\n\n<li><strong>Sampling Rate Control:<\/strong>&nbsp;The&nbsp;<code>HAL_Delay(50)<\/code>&nbsp;at the end creates a&nbsp;<strong>20 Hz<\/strong>&nbsp;sampling rate. This is a common practice in embedded UI to prevent &#8220;bouncing&#8221; or rapid-fire data processing that could lead to erratic cursor movement or multiple unintended clicks.<\/li>\n<\/ol>\n\n\n\n<p>That all for this guide.<\/p>\n\n\n\n<p>Save, build the project and run it as follows:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"34\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/image-1-1024x34.png\" alt=\"\" class=\"wp-image-4349\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/image-1-1024x34.png 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/image-1-300x10.png 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/image-1-768x26.png 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/image-1-1536x51.png 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/image-1-1150x38.png 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/image-1-750x25.png 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/image-1-400x13.png 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/image-1-250x8.png 250w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/image-1.png 1986w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4. Results:<\/h2>\n\n\n\n<p>Start a debug session and add ID, xTouch and yTouch variables to the live expression and you should get the following: <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"541\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Screen-Recording-2026-04-15-at-11.27.42-1024x541.gif\" alt=\"\" class=\"wp-image-4367\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Screen-Recording-2026-04-15-at-11.27.42-1024x541.gif 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Screen-Recording-2026-04-15-at-11.27.42-300x158.gif 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Screen-Recording-2026-04-15-at-11.27.42-768x405.gif 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Screen-Recording-2026-04-15-at-11.27.42-1150x607.gif 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Screen-Recording-2026-04-15-at-11.27.42-750x396.gif 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Screen-Recording-2026-04-15-at-11.27.42-400x211.gif 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2026\/04\/Screen-Recording-2026-04-15-at-11.27.42-250x132.gif 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Next, we shall add LvGL to the mix and see how things will go from there.<\/p>\n\n\n\n<p>Stay tuned.<\/p>\n\n\n\n<p>Happy coding \ud83d\ude09<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Part 5, we transition from hardware configuration to data acquisition by implementing the logic required to extract precise X and Y coordinates from the STMPE811. We will explore how to poll the internal FIFO buffer and convert raw analog readings into meaningful screen positions for your user interface. In this guide, we shall cover [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,19,11,12],"tags":[],"class_list":["post-4363","post","type-post","status-publish","format-standard","hentry","category-embedded-systems","category-lcd","category-peripheral-drivers","category-stm32"],"_links":{"self":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/4363"}],"collection":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4363"}],"version-history":[{"count":2,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/4363\/revisions"}],"predecessor-version":[{"id":4369,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/4363\/revisions\/4369"}],"wp:attachment":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}