EDIT:
I don't have an LCD screen, so I didn't test the code with an LCD, but the code that just dumps the parsed data back to serial works.
//#include <LiquidCrystal.h>
#include <ArduinoJson.h>
const struct LCDPos {
uint8_t x;
uint8_t y;
} lcd_pos[] = {
{0, 0},
{8, 0},
{0, 1},
};
//LiquidCrystal lcd(12, 11, 7, 6, 5, 4);
void setup() {
Serial.begin(115200);
//lcd.begin(16, 2);
}
void loop() {
StaticJsonBuffer<100> jsonBuffer;
JsonObject& root = jsonBuffer.parseObject(Serial);
if (root == JsonObject::invalid())
return;
Serial.println("JSON received");
uint8_t i = 0;
for (JsonObject::iterator it = root.begin(); it != root.end() && i < (sizeof(lcd_pos) / sizeof(lcd_pos[0])); ++it, i++)
{
//lcd.setCursor(lcd_pos[i].x, lcd_pos[i].y);
//lcd.print(it->value.asString());
Serial.print(i);
Serial.print(':');
Serial.print(lcd_pos[i].x);
Serial.print(',');
Serial.print(lcd_pos[i].y);
Serial.print(' ');
Serial.println(it->value.asString());
}
Serial.println();
}
If I send
{"TPS":"0.40","MAP":"0.95","LOAD":"14"}{"LOAD":"2.40","RPM":"4200","INJECTION_TIME":"4.87"}
over the serial, it returns
JSON received
0:0,0 0.40
1:8,0 0.95
2:0,1 14
JSON received
0:0,0 2.40
1:8,0 4200
2:0,1 4.87