title: Parsing JSON on the Arduino
body: <p>I'm using the <a href="https://github.com/bblanchon/ArduinoJson" rel="nofollow">ArduinoJson</a> library. There is a <a href="https://github.com/bblanchon/ArduinoJson/blob/master/examples/JsonParserExample/JsonParserExample.ino" rel="nofollow">great example</a> for parsing a single JSON object in the source code. I am attempting to iterate over an array of JSON objects:</p>
  
  <pre><code>#include &lt;JsonParser.h&gt;
  
  using namespace ArduinoJson::Parser;
  
  void setup() {
    Serial.begin(9600);
  
    char json[] = "[{\"sensor\":\"gps\",\"time\":1351824120,\"data\":[48.756080,2.302038]}, \
      {\"sensor\":\"gps\",\"time\":1351824140,\"data\":[50.756080,21.302038]}]";
  
    JsonParser&lt;32&gt; parser;
    JsonArray root = parser.parse(json);
  
    if (!root.success()) {
      Serial.println("JsonParser.parse() failed");
      return;
    }
  
    for (JsonArrayIterator item = root.begin(); item != root.end(); ++item) {
      // unsure of what to do here.
  
      Serial.println((*item)["data"]);
      // results in: 
      // ParseJsonArray:21: error: call of overloaded 
      //   'println(ArduinoJson::Parser::JsonValue)' is ambiguous
  
      JsonObject something = JsonObject(*item);
      Serial.println(something["sensor"]);
      // results in :
      // ParseJsonArray:26: error: call of overloaded
      //   'println(ArduinoJson::Parser::JsonValue)' is ambiguous
    }
  }
  
  void loop() {}
  </code></pre>
  
  <p><code>item</code> is of type JsonValue. I would like to treat it as a JsonObject and pull some data out of it.</p>