Skip to content

Parsing JSON array into array of object #6

@nitinjs

Description

@nitinjs

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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions