ArduinoJSON v.6 JsonObject as function parameter error
Posted: Sat Jan 26, 2019 3:29 am
Hello, colleagues,
I've met with the strange thing. I created some sketch with ArduinoJSON v.6.
I created a function
and after compilation I got the error:
[hr]Arduino: 1.8.8 (Windows 10), Board: "WeMos D1 R1, 160 MHz, Flash, Enabled, 4M (1M SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 921600"
ModbusConfig:180:18: error: variable or field 'printResult' declared void
ModbusConfig:180:18: error: 'JsonObject' was not declared in this scope[hr]
but if I Invoke JsonObject in any function it works without any problem. E.g.:
compiled successfully. I don't understand what's a problem.
I've met with the strange thing. I created some sketch with ArduinoJSON v.6.
I created a function
Code: Select all
void printResult(JsonObject res)
{
}
and after compilation I got the error:
[hr]Arduino: 1.8.8 (Windows 10), Board: "WeMos D1 R1, 160 MHz, Flash, Enabled, 4M (1M SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 921600"
ModbusConfig:180:18: error: variable or field 'printResult' declared void
ModbusConfig:180:18: error: 'JsonObject' was not declared in this scope[hr]
but if I Invoke JsonObject in any function it works without any problem. E.g.:
Code: Select all
void printResult()
{
JsonObject res;
}
compiled successfully. I don't understand what's a problem.