// ------------------------------------------------------------- // R+ connect SDA // R- SCL // ------------------------------------------------------------- task main() { byte inbuffer[]; UseRS485(); // (1) Port S4 configured for RS485 RS485Enable(); // (2) turn on RS485 //RS485Uart(HS_BAUD_57600, HS_MODE_DEFAULT); // (3) initialize UART 57600 RS485Uart(HS_BAUD_115200, HS_MODE_DEFAULT); // (3) initialize UART 112500 TextOut(0, LCD_LINE1, " NXT <> laptop"); while (true) { while (!RS485DataAvailable()) {} // wait for a message to arrive. RS485Read(inbuffer); ClearScreen();// clear screen before dislay new string TextOut(0, LCD_LINE4, ByteArrayToStr(inbuffer)); //Dislay message inbuffer=0; Wait(1000); } }