Skip to content

Commit c9c05ea

Browse files
committed
cosmetic formating
1 parent 8dfc171 commit c9c05ea

File tree

3 files changed

+7
-28
lines changed

3 files changed

+7
-28
lines changed

examples/Basic/Basic.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ void sendData(uint8_t port)
145145
ttn.sendBytes(payload, sizeof(payload), port);
146146

147147
// Set RN2483 to sleep mode
148-
ttn.sleep( 60000 );
148+
ttn.sleep(60000);
149149

150150
// This one is not optionnal, remove it
151151
// and say bye bye to RN2983 sleep mode

examples/BatteryMonitorLPP/BatteryMonitorLPP.ino

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,3 @@
1-
// **********************************************************************************
2-
// Ultra Low Power BatteryMonitorLPP for TheThingsNode device
3-
// **********************************************************************************
4-
//
5-
// This program just send lora packet containing Battery info to myDevices portal
6-
// if button is pressed the batterey packet is send and the push button duration
7-
// is also added
8-
//
9-
// This example also take into account of setting Lora Module to sleep mode this
10-
// allow to reduce consumption in sleep mode from 3.2mA to 280µA
11-
//
12-
// Written by Charles-Henri Hallard (CH2i)
13-
//
14-
// History : V1.00 2018-02-11 - First release based on TTN CayenneLPP example code
15-
// V1.01 2018-02-12 - Added Hard reset of Lora module at startup
16-
// - Fixed issue https://github.com/TheThingsNetwork/arduino-node-lib/issues/9
17-
// - Enable Low Power of Lora Module
18-
//
19-
// **********************************************************************************
20-
211
#include <TheThingsNode.h>
222
#include <CayenneLPP.h>
233

@@ -113,10 +93,10 @@ void sendData(uint8_t port, uint32_t value)
11393
// please myDeviceCayenne add counter value type to
11494
// avoid us using analog values to send counters
11595
if (port == PORT_BUTTON) {
116-
debugSerial.print(F("Button:\t"));
117-
debugSerial.print(value);
118-
debugSerial.println(F("ms"));
119-
lpp.addAnalogInput(7, value/1000.0);
96+
debugSerial.print(F("Button:\t"));
97+
debugSerial.print(value);
98+
debugSerial.println(F("ms"));
99+
lpp.addAnalogInput(7, value/1000.0);
120100
}
121101

122102
ttn.sendBytes(lpp.getBuffer(), lpp.getSize(), port);

src/TheThingsNode.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ void TTN_BUTTON_FN()
7373
uint8_t trigger = getPinChangeInterruptTrigger(digitalPinToPCINT(TTN_BUTTON));
7474
if (trigger == FALLING)
7575
{
76-
//Serial.println(F("IPRESS"));
7776
TTN_BUTTON_PRESS = true;
7877
}
7978

@@ -224,7 +223,7 @@ void TheThingsNode::loop()
224223
// Don't go to sleep mode while button is still pressed
225224
// because if so, timer of ms will be stopped and duration
226225
// of pressed button will not work
227-
if ( this->buttonPressed ) {
226+
if (this->buttonPressed) {
228227
delay(100);
229228
TTN_INTERVAL = TTN_INTERVAL + 100;
230229
} else {
@@ -749,7 +748,7 @@ TheThingsNode::TheThingsNode()
749748
pinMode(TTN_BLUE_LED, OUTPUT);
750749
setColor(TTN_BLACK);
751750

752-
// set pin mode every time to avoid constraining the user about when the pin is initialized
751+
// hardware reset of LoRa module, so module is reset on sketch upload
753752
#ifdef TTN_LORA_RESET
754753
pinMode(TTN_LORA_RESET, OUTPUT);
755754
digitalWrite(TTN_LORA_RESET, LOW);

0 commit comments

Comments
 (0)