File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff line change 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
130132void 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 }
You can’t perform that action at this time.
0 commit comments