Oferta de
STM32 ULTIMATE PROJECT GUIDE: A Comprehensive Guide to Advanced Projects and Applications Unleash the Power of Microcontrollers Mastering With STM32 (English Edition)
Mais ofertas de Generico
Sob Consulta
* Confira sempre o valor atualizado antes de efetuar a compra.
Mais informações da Oferta
STM32 ULTIMATE PROJECT GUIDE: A Comprehensive Guide to Advanced Projects and Applications Unleash the Power of Microcontrollers Mastering With STM32 (English Edition)
✔I am starting the touch GFX series for STM 32. I guess you have already tried some experiments with the touch GFX, and you already know how to create a project for your board. This is the first project in the series and today we will see how to toggle the LED using the button on the display. So let's start the touch GFX designer. Click Create and choose your board. If you are doing this first time, you will need an internet connection or else it won't show anything.
✔I am using STM 32 F 750 Discovery Board, give the name to the project and click Create. All right, we got our blank project. There are a lot of things here, which we will cover in the future projects. Today we will start with the simple image. Let's add the image to our display. If you click on the image, you will get its properties on the right, like the name, its location, et cetera. To add the image, click this image and select from here.
✔If you don't have any image, you can choose from the preloaded backgrounds. They are available for pretty much every size, or else click Add and choose the image. The image should be in the ping format. I already have one created for backgrounds. So this will be our background image. And now we will add a button on the display.
✔I am adding this toggle button as we are going to toggle the LED here are the properties for this button. You can choose the style here. Or how will it look if pressed or released. Let's keep the default state to pressed. So it will be in on state by default. All right, the button has been created. Now what will happen when we press this button? Well, we need to define that. And to do that we will have the interaction.
✔This interaction will trigger when the button is clicked. The button is this one that we created just now. In the action, you can choose whatever action you want. But for toggling the LED, we will call a new virtual function, which we will define later in the code. The name for the function, let's keep it toggle led interaction name. Let's keep it same. So that's it for the design part. Click here to generate the code let's open the files. This is the touch GFX folder. We will go back to Project and open the cube IDE.