Skip to content

Instantly share code, notes, and snippets.

@piyushagade
piyushagade / jsonParser.cpp
Created October 3, 2018 19:03
Simple (naive??) JSON Parser for Arduino. The function returns a value from a JSON string for a provided key.
String parseJSON(String json, String key){
String pair = "";
String result, temp_key, value;
for(int i = 0; i < json.length(); i++){
if(json.charAt(i) == '['){
// Do nothing
}
else{
if(json.charAt(i) == ',')