Open phonicmouse opened 8 years ago
when i'm compiling this:
HTTPClient client("api.openweathermap.org", weatherApiServer); FILE* result = client.getURI("/data/2.5/weather?q=torino&appid=217fd2d8848ef3352b55a089f72a5e55"); int returnCode = client.getLastReturnCode(); if (result != NULL) { int c; float tempK; float tempC; String response; while ((c = fgetc(result)) != EOF) { response += (char) c; } char* json_string; response.toCharArray(json_string, response.length()); char** jsonFilter = {"main", "temp", "pressure", "humidity", NULL}; aJsonObject* stream = aJson.parse(result, jsonFilter); }
i get the following error:
Arduino:1.6.6 (Windows 10), Scheda:"Arduino/Genuino Uno" C:\Users\Phonic Mouse\Documents\Arduino\ArduMeteoTwitter\ArduMeteo\ArduMeteo.ino: In function 'void loop()': C:\Users\Phonic Mouse\Documents\Arduino\ArduMeteoTwitter\ArduMeteo\ArduMeteo.ino:60:65: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] HTTPClient client("api.openweathermap.org", weatherApiServer); ^ C:\Users\Phonic Mouse\Documents\Arduino\ArduMeteoTwitter\ArduMeteo\ArduMeteo.ino:62:101: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] FILE* result = client.getURI("/data/2.5/weather?q=torino&appid=217fd2d8848ef3352b55a089f72a5e55"); ^ ArduMeteo:77: error: scalar object 'jsonFilter' requires one element in initializer char** jsonFilter = {"main", "temp", "pressure", "humidity", NULL}; ^ exit status 1 scalar object 'jsonFilter' requires one element in initializer
when i'm compiling this:
i get the following error: