Start a new topic

Interrupt on serial port

Hello. During the program I have delays are due to meter reading. For example:

  

#include <Nextion.h> 
/*
The display is connected to pins 2 and 3 (HardwareSerial)
*/
NexButton b0 = NexButton(0, 2, "b0");

NexTouch *nex_listen_list[] =
{
    &b0,
    NULL
}

void b0PopCallback(void *ptr)
{
    int i;
    i++;
}

void setup()
{
    nexInit();
    b0.attachPop(b0PopCallback, &b0);
}

void loop()
{
    nexLoop(nex_listen_list);
    delay(50);
} 

 Because of delays in the loop touchscreen does not work. I would like to make some kind of interrupt, such as a serial port. I really hope for your help!

Login or Signup to post a comment