Skip to content

Commit

Permalink
Extra comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobalation committed Mar 26, 2020
1 parent c64119a commit 0f7e57c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
9 changes: 9 additions & 0 deletions Node main module/src/autoconnectPages.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@
"type": "ACInput",
"label": "Update Interval (ms)"
},
{
"name": "ledSettingRadio",
"type": "ACRadio",
"label": "Blink LED when sending the data",
"value":[
"On",
"Off"
]
},
{
"name": "save",
"type": "ACSubmit",
Expand Down
7 changes: 4 additions & 3 deletions Node main module/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "protocol.h"
#include "customPages.h"

// Time is in milliseconds
#define LED_TICKER 33
#define BUTTON_PIN 32
#define DEFAULT_UPDATE_INTERVAL 60000
Expand Down Expand Up @@ -127,6 +128,7 @@ void asyncBlink(unsigned long ms = 0)
}
}

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

pushedDownTime = NULL;
}


}


Expand Down Expand Up @@ -698,11 +698,12 @@ void loop()
{
scanDevices();
fetchData();
// Send latest data if it is possible to do so
if ((currentJSONReply != NULL || currentJSONReply != "") && (WiFi.status() != WL_IDLE_STATUS) && (WiFi.status() != WL_DISCONNECTED))
{
if (WiFi.getMode() == WIFI_MODE_STA){
sendDataToEndpoint();

// blink once data is sent
if (nodeLEDSetting == "On"){
asyncBlink(200);
}
Expand Down

0 comments on commit 0f7e57c

Please sign in to comment.