JsonParserGeneratorRK icon indicating copy to clipboard operation
JsonParserGeneratorRK copied to clipboard

Parsing JSON array into array of object

Open nitinjs opened this issue 6 years ago • 0 comments

how do I parse the scheduleJson into array of Schedule class?

String scheduleJson = "[{hour:1, isFlashWindow: false}, {hour:2, isFlashWindow: false}, {hour:7.30, isFlashWindow: true}, {hour:8, isFlashWindow: false}]";
class Schedule{
    public:
        float hour;
        bool isFlashWindow;
};
Schedule schedules[5] = {};

void setup() {
    
}

void loop() {
    //how do I parse the scheduleJson into array of Schedule class
}

nitinjs avatar Mar 10 '20 06:03 nitinjs