Why do you need a library? It's really simple to send data and commands back and forth between the Teensy and the Nextion. On the Teensy side, you just need functions to convert the serial data to a string, float, integer, byte, etc.. My loop method is just one long switch case (around 200 cases
).
Teensy side example:
Code:
case 78: // N - GetFileListFromSD
{
Serial.println("GetFileListFromSD");
GetFileListFromSD();
break;
}
case 79: // O - Sync Axis Speed
{
configSync.speedPercent_Axis_Z = (int)GetSerialFloat(serialId);
EEPROM.put(eePromAddress_Sync, configSync);
#ifdef DEBUG
Serial.print(spindle_SpeedPercent_Char);
Serial.println(configSync.speedPercent_Axis_Z);
#endif // DEBUG
break;
}
Nextion side:
Code:
print "N" // Ascii 78
printh FF
Note: I use a single FF to terminate serial packet for the Teensy, Nextion requires three.