In my recent project, I am working with serial data. Till now, I'm able to receive data and display on LCD. Now, suddenly I can't get any serial data. Nothing display on LCD.
My incoming string is:
{"Action":"ONE","TPS":"0.40","MAP":"0.95","LOAD":"14"}
And my code is below:
#include<LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 7, 6, 5, 4);
String response = "";
bool begin = false;
void setup()
{
Serial.begin(9600);
lcd.begin(16, 2);
}
void loop()
{
while(Serial.available() || !begin)
{
char in = Serial.read();
if (in == '{')
{
begin = true;
}
if(begin)
{
response += (in);
}
if(in == '}')
{
break;
}
delay(1);
}
lcd.setCursor(0, 0);
lcd.print(response);
}