Skip to content

Commit 401baa8

Browse files
authored
doc: tweaks to attn example (#24)
* improve attn example * format tweaks
1 parent 30a603e commit 401baa8

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

examples/Example4_InboundInterrupts/Example4_InboundInterrupts.ino

+8-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include <Wire.h>
2626

2727
// GPIO pin definitions
28-
#define ATTN_INPUT_PIN 5 // Any digital GPIO pin on your board
28+
#define ATTN_INPUT_PIN 5 // Any digital GPIO pin on your board
2929

3030
// Parameters for this example
3131
#define INBOUND_QUEUE_NOTEFILE "my-inbound.qi"
@@ -72,12 +72,18 @@ void setup() {
7272
JAddStringToObject(req, "product", myProductID);
7373
#if myLiveDemo
7474
JAddStringToObject(req, "mode", "continuous");
75+
JAddBoolToObject(req, "sync", true);
7576
#else
7677
JAddStringToObject(req, "mode", "periodic");
7778
JAddNumberToObject(req, "minutes", 60);
7879
#endif
7980
notecard.sendRequest(req);
8081

82+
// Disarm ATTN To clear any previous state before rearming
83+
req = notecard.newRequest("card.attn");
84+
JAddStringToObject(req, "mode", "disarm,-files");
85+
notecard.sendRequest(req);
86+
8187
// Configure ATTN to wait for a specific list of files
8288
req = notecard.newRequest("card.attn");
8389
const char *filesToWatch[] = {INBOUND_QUEUE_NOTEFILE};
@@ -131,8 +137,7 @@ void loop() {
131137

132138
// Simulate Processing the response here
133139
char *myCommandType = JGetString(body, INBOUND_QUEUE_COMMAND_FIELD);
134-
notecard.logDebugf("INBOUND REQUEST: %s\n\n", myCommandType);
135-
140+
NoteDebugf("INBOUND REQUEST: %s\n\n", myCommandType);
136141
}
137142

138143
}

0 commit comments

Comments
 (0)