 Hello, my name is Gustavo Sosa and welcome to another video from ST Microelectronics. This is the second part of getting started with the GHQ widget. At part one, the UI was generated and the ADC configured. In this video, we'll continue linking the ADC to the UI. Now we add the code needed. We start with main.cfile. This define is the mcvoltage supply used for the voltage conversion. We add the variables needed to convert the ADC values to voltage and temperature and the right to pass values to the user interface. After QMX peripheral configurations, at user code 2, we calibrate the ADC. At the white loop, we convert ADC values to voltage and temperature and clear and set some flags. The flags let us know when to start the conversion, if the conversion is ready and to tell to the UI that the conversion is ready. Finally, at user code 4, we have the ADC interrupt subroutine. Here, we read the ADC conversions and copy them to an array so it can be used. Open model.cfile. At this file is the interaction between TouchFX and the application. We add the flags needed. The counter for a delay is initialized and the tick method already predefined by TouchFX. The tick function is called every frame. At the tick method, every certain time the ADC conversion will be triggered and after that will be passed to the UI using model listener that is a pointer to the active presenter. Open the model.cfile by placing the cursor on it and F3. Add a variable usage. Now, open model listener header file and add a definition of the function used to pass information to the UI to the presenter first and then to the view. Save the three files. Now, open screen one presenter cpp file. We will add the method called by that model. This method will transmit to the view when voltage and temperature values are ready. Open its header file and declare a function. Save the files. Finally, open screen one view cpp file. Add the array that have the voltage and the temperature values. We initialize the gauges at the screen entry. Then, add the method handle tick event that will update the gauges using the update value method from the gauge widget. Open screen one header file and declare the functions and variables. Save the files. Now, we are ready to compile. Before debugging, we need to add the SPI external flash memory external loader to ST32Q by D. The external loaders led to program external memories through the ST32s using ST tools like ST32Q by D or ST32Q programmer. The touch effect generated project have the external loader needed. We need to copy it at the cube ID external loader location so it can be used. Add the touch effect project folders navigate to GCC folder. Copy the file with extension stldr mx25l6433f st32g071b Copy it to ST32Q ID external loaders folder. Now, we can debug but we need to add the external loader first. Go to the debug icon click on the arrow next to it go to the debug configurations. At the project debug configuration go to the debugger tab scroll down to external loader. Hit on scan and look for the external loader. Select it and start the debug session. At popup window select switch. The microcontroller and the external SPI memory will be flashed. At light watch, we add a tool erase the ADC raw data and the converted to voltage and temperature. Start the debug session by hitting the debug icon or with F8. We can observe the variations while the potentiometer is moved. Temperature variation is very small. Here we have the gauges linked to the ADC in this low cost platform. Thank you for watching.