 Hello, my name is Gustavo Sosa and welcome to another video from STMicroelectronics. This is the second part of using how our button is clicked at interactions. As part one, the UI was generated. In this video, we'll continue with implementation at QBid. After generation, open the project folder location from the folder icon at the bottom right. Navigate to the STM32 QBid folder and open the QBid project. At QBid, open the ICO file. This could be done with QBMX2. At the dialog box, select continue, so QBMX project is not updated. We will add the GPIO for the push button. It is at PC13. We will look for it with search. Click on the pin and we'll select GPIO output if we'll be by polling or GPIO XT if I interrupt. We will select XT, so no need to come back and reconfigure the GPIO. We need to go to the interrupt vector controller and activate PC13 interrupt. It is vector XT 15-10. Now we generate code by saving the file. Here is the code generated for PC13. So the how our button can be used, we need to add its controller. We will need to add some files. Click a new source file icon on the top, confirm file location and name it. In this case is button controller CPP. Click at finish. At the new file, we'll add two methods, one for initialization, another to sample the button or key. These methods are requested and called by TouchFX. At sample, the GPIO is checked and returned if was pressed or not, with its related key number. We need to create a header file. Today we will use an external text editor. The header file will have the methods and variable declaration. Save it at the core include path. Now we need to tell TouchFX to call the button method. Open TouchFX HAL CPP file, it is under TouchFX target. We will add the button controller header file. Add a pointer to the controller. The button controller will be called. Save the file and compile. Click at the book icon on the top. At dialogue, click switch. Go to project explorer tab and open the button controller source file CPP. Add a breakpoint inside sample method. Run the code by the run icon at the top or with F8. Every time we push the push button, the breakpoint is reached. Let's do the changes so now we'll be by the interrupt. Open main C file and at private variables define a flag. Look for user code for. Here the interrupts routine will be added. A flag is set, this flag will be checked by button controller. At the button controller source file, we'll add a flag and modify the sample method so now we'll check for the flag. Add the definition for the flag. Comment at init, at sample, modify to check only for the flag. Save the file, compile. Go to the button controller source file and add a breakpoint inside sample method. Add the book. Click at the book icon on the top. At dialogue, click switch. Run the code by the run icon at the top or with F8. Every time we push the push button, the breakpoint is reached. Here is the UI. The screen changes either with the hardware push button or the button at the screen. Thank you for watching.