Took the code from https://github.com/nlohmann/json, all credit goes to them, I just put it into a pros template and made it open files.
Install using the latest zip in releases
Add this to main.h(or wherever you need to include it)
#include "json/json.hpp"
Additionally, if you want to use it easier,
using json = nlohmann::json;
Put all assets you want on the robot in the "static folder". They will be sent to the robot every time you upload.
Include the "asset.hpp" file
#include "json/asset.hpp"
Load and parse the file
// Load the asset file(from static/)
ASSET(FILE_json);
// parse the file
json parsed_file = open_asset_as_json(FILE_json);
Saving assets is not supported
Include the "asset.hpp" file
- Note: sd card MUST be formatted as a FAT32 volume
#include "json/sd.hpp"
Load and parse the file
// parse the file
json parsed_file = open_sd_file_as_json("/usd/example.json");
Dump the json file to the sd card
// parse the file
save_sd_from_json("/usd/example.json", jsonObject);
More documentation on using the JSON libary can be found here: https://github.com/nlohmann/json