c - Error running example ArduinoJson -


I'm having trouble running an example

I have already installed the library and one Simple example is run.

/ * * Arduino JSON Library - Parser Examples * Benoit Blanchard 2014 - MIT License * / #include & lt; JsonParser.h & gt; Using Namespace ArduinoJson :: Parser; Zero setup () {serial.begin (9600); Four Jason [] = "{\" sensor \ ": \" GPS \ ", \" time \ ": 1351824120, \" data \ ": [48.756080,2.302038]}"; JsonParser & lt; 16 & gt; Parser; JsonObject root = parser.pars (jsn); If (! Root.success ()) {Serial.println ("JsonParser.parse () failed"); Return; } Char * sensor = root ["sensor"]; Long time = root ["time"]; Double latitude = root ["data"] [0]; Double longitude = route ["data"] [1]; Serial.println (sensor); Serial.println (time); Serial. Printline (latitude, 6); Serial. Printline (longitude, 6); } Zero loop () {}

but I am getting this error:

  JsonParser Example: 8: Error: did not declare 'ArduinoJson' JsonParser example: 8: Error: 'Parser' is not a namespace-name JsonParser Example: 8: Error: Expected namespace-name ';' Token JsonParserExample.ino: In the 'zero setup ()' function: JsonParserExample: 18: Error: 'JsonObject' was not declared in this area JsonParser example: 18: Error: Estimated ';' JsonParser Example: 20: Error: 'Route' was not declared in this area JsonParser Example: 26: Error: 'Route' was not declared in this area  

Problems with name space, but I can not find it ..

I tried downloading it and it works. I am using Arduino IDE 1.0.5 r2.

Did you have the "installed" library correctly? I mean

  1. Download the archive from Gitub (by clicking on "download zip", on the right)
  2. Remove the content in the "libraries" folder inside the sketch folder <
  3. Start Arduino IDE

You must have a file at the third point

  & lt; Your Sketch Dior & gt; \ Libraries \ ArduinoJson \ ArduinoJson.sln & lt; Your Sketch Dior & gt; \ Libraries \ ArduinoJson \ CHANGELOG.md & lt; Your sketch dir & gt; \ Libraries \ ArduinoJson \ JsonParser \ JsonParser.vcxproj and if you have done everything correctly in Arduino IDE, then you should look under file-> Examples, ArduinoJson folder and, inside, two examples. 


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -