Skip to content

Commit 0f7e57c

Browse files
committed
Extra comments
1 parent c64119a commit 0f7e57c

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

Node main module/src/autoconnectPages.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,15 @@
6969
"type": "ACInput",
7070
"label": "Update Interval (ms)"
7171
},
72+
{
73+
"name": "ledSettingRadio",
74+
"type": "ACRadio",
75+
"label": "Blink LED when sending the data",
76+
"value":[
77+
"On",
78+
"Off"
79+
]
80+
},
7281
{
7382
"name": "save",
7483
"type": "ACSubmit",

Node main module/src/main.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "protocol.h"
1515
#include "customPages.h"
1616

17+
// Time is in milliseconds
1718
#define LED_TICKER 33
1819
#define BUTTON_PIN 32
1920
#define DEFAULT_UPDATE_INTERVAL 60000
@@ -127,6 +128,7 @@ void asyncBlink(unsigned long ms = 0)
127128
}
128129
}
129130

131+
// Button input checking function
130132
void checkButton(){
131133
static unsigned long pushedDownTime = NULL;
132134
if (pushedDownTime == NULL && digitalRead(BUTTON_PIN) == LOW){ // Button being pressed
@@ -153,8 +155,6 @@ void checkButton(){
153155

154156
pushedDownTime = NULL;
155157
}
156-
157-
158158
}
159159

160160

@@ -698,11 +698,12 @@ void loop()
698698
{
699699
scanDevices();
700700
fetchData();
701+
// Send latest data if it is possible to do so
701702
if ((currentJSONReply != NULL || currentJSONReply != "") && (WiFi.status() != WL_IDLE_STATUS) && (WiFi.status() != WL_DISCONNECTED))
702703
{
703704
if (WiFi.getMode() == WIFI_MODE_STA){
704705
sendDataToEndpoint();
705-
706+
// blink once data is sent
706707
if (nodeLEDSetting == "On"){
707708
asyncBlink(200);
708709
}

0 commit comments

Comments
 (0)