![]() ![]() NexInit() //inicializa a comunicação com o nextionītnNext.attachPop(btnNextPopCallback, &btnNext) //callback para o evento de release do botão btnNextītnBack.attachPop(btnBackPopCallback, &btnBack) //callback para o evento de release do botão btnBack In Loop, we work as a listener for the press and release events of the objects used in the display. In Setup, we initialize communication with Nextion. Nesse array, declaramos os objetos Nextion que terão interação de eventos touch NexButton btnBack = NexButton(1, 3, "btn_back") //botão da página 1 NexVariable valueSlider = NexVariable(1, 5,"valueSlider") //(objeto do nextion) variável que guarda o valor do slider NexText statusPWM = NexText(1, 4, "status_pwm") //texto com o status do pwm NexSlider slider = NexSlider(1, 2, "slider_pwm") //slider que controlará o PWM do LED ![]() NexDSButton btnLight = NexDSButton(1, 1, "btn_light") //botão de duplo estado para controlar o LED NexWaveform waveform = NexWaveform(0, 6, "waveform") //componente do gráfico de temperatura e umidade NexText txtHumid = NexText(0, 5, "txt_humid") //texto com o valor da umidade NexText txtTemp = NexText(0, 2, "txt_temp") //texto com o valor da temperatura NexButton btnNext = NexButton(0, 3, "btn_next") //botão da página 0 NexProgressBar progHumid = NexProgressBar(0, 16, "prog_humid") //Progress Bar umidade * DECLARAÇÕES DOS OBJETOS DO NEXTION: */ NexProgressBar progTemp = NexProgressBar(0, 1, "prog_temp") //Progress Bar temperatura We also have the array in which we declare Nextion objects that will have touch event interaction. variáveis de controle de tempo, para funcionar como um cronômetro ![]() Uint8_t pinLED = 3 //pino que ligamos o LED no arduinoīool is = true //variável de controle para saber se é a página ZERO que está em telaīool isLedOn = false //variável de controle para saber se o LED está acesoĬhar buffer = //buffer para armazenar dados string variáveis que armazenam os dados do DHT22 Static int pinDHT22 = 7 //pino que ligamos o DATA do DHT22 no arduino #include "Nextion.h" //biblioteca para comunicação com o display NEXTION #include //biblioteca para comunicação com o DHT22 We also define the variables that store the data of DHT22 and for control of the Led, among others. We will include the libraries for communication with the Nextion display and for communication with the DHT22. In addition, we’ll create an example using a microcontroller running with Nextion. In this video today, we will learn about the IDE Nextion Editor, create a simple example without a microcontroller, and simulate in the Nextion simulator. Important information regarding this is that Display Nextion uses STM32. ![]() The microcontroller, an Arduino Uno in this case, just keeps sending the code. Therefore, in this "smart display,” all graphic processing is done by Nextion itself. This differs from traditional displays, in which I have to execute the desired drawings, pixel by pixel. For an example: When I want the lamp to appear on the screen (same as the image shown below), I will not need to draw this entire lamp, as I will simply record the drawing on the display and print its ID. How does this differentiate from the others? In addition to the graphics controller, it has a microcontroller connected in the Uart TX RX. Have you ever learned about "smart display?” Well today, I present the Display Nextion. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |