Why JsonVariant cannot be converted to char?
Created by: interimlife
I use ARDUINO IDE 1.6.11 from arduino.cc I met errors in my program. I can show these errors by JsonParserExample (included in library)
char json[] = "{"sensor":"gps","time":1351824120,"data":[48.756080,2.302038]}"; -->>original. signed char json[] = "{"sensor":"gps","time":1351824120,"data":[48.756080,2.302038]}"; -->>error. unsigned char json[] = "{"sensor":"gps","time":1351824120,"data":[48.756080,2.302038]}"; -->>error. uint8_t json[] = "{"sensor":"gps","time":1351824120,"data":[48.756080,2.302038]}"; -->>error. int8_t json[] = "{"sensor":"gps","time":1351824120,"data":[48.756080,2.302038]}"; -->>error.
change time key value. char json[] = "{"sensor":"gps","time":135,"data":[48.756080,2.302038]}";
and change time variable. long to char.
unsigned char time = root["time"]; -> OK. signed char time = root["time"]; -> OK. uint8_t time = root["time"]; -> OK. int8_t time = root["time"]; -> OK. but.. char time = root["time"]; -> error.
I'm poor English. I beginning programming. I don't know why I met these errors.