hello, people,
I have bought a new display to myself.
it is the Nextion HMI display 3.2 inches
I use a Arduino Mega5260.
I do not understand like I switch on a LED with a display button.
does one of you have experiences with the display?
I would like to switch on 4 LED with 4 displays buttons.
I have found an example code: but i don´t know......
int char1, char2;
int charflag=0;
void setup () {
Serial.begin (9600);
pinMode (13, OUTPUT);
}
void loop () {
if (Serial.available ()> 1)
{
if (charflag)
{
char2=Serial.read ();
if (char2 == 0) digitalWrite (13, HIGH);
else if (char2 == 0x01) digitalWrite (13, LOW);
charflag=0;
}
else
{
char1=Serial.read ();
if (char1 == 0x65) charflag=1;
}
}
}
maybe you can help me?
greets
sascha