I'm using a Nextion display to generate tokens on serial. Different buttons on the display generate a corresponding token.
When I wire the display through an FTDI, the serial data is as expected.
But when I read the display data on SoftwareSerial through the arduino and print it to serial monitor, its not the same data anymore.
So for example, if Button A is generating "1" on toggling, while the display is wired directly through an FTDI, serial monitor shows "1", but through softwareSerial it shows "49"
I intend to use the incoming date with a switch case.
#include <SoftwareSerial.h>
SoftwareSerial nextion(10, 11);
int command;
void setup() {
Serial.begin(9600);
nextion.begin (9600);
}
void loop() {
if (nextion.available()) {
int command = nextion.read ();
Serial.println (command);
delay (1000);
}
}