Trying to configure notecard for GPIO mode with Notefile from Feather ESP32 on Notecarrier AF.
I used the following sample C/C++ code for Notecard API for card.aux:
J *req = NoteNewRequest(“card.aux”);
JAddStringToObject(req, “mode”, “gpio”);
J *pins = JCreateArray();
JAddItemToArray(pins, “off”); // AUX1
JAddItemToArray(pins, “input-pullup”); // AUX2
JAddItemToArray(pins, “off”); // AUX3
JAddItemToArray(pins, “off”); // AUX4
JAddArrayToObject(req, “usage”, pins);
JAddBoolToObject(req, “sync”, true);
JAddStringToObject(req, “file”, “statechange.qo”);
NoteRequest(req);
Using the Arduino IDE and the most recent blues library, I get error on the JAddArrayToObject command, because in the n_json.c library the JAddArrayToObject function only accepts 2 parameters when being called: N_CJSON_PUBLIC(J*) JAddArrayToObject(J * const object, const char * const name).
Any suggestions on how to get this working would be appreciated.
The end goal is to use card.attn to wake up the ESP32 mcu when either the sleep interval expires or when the button connected to Aux2 is pushed.