Skip to content

Commit 7c4371c

Browse files
Merge pull request #200 from TheThingsNetwork/fix/led-builtin-dependency
Removed dependency on LED_BUILTIN
2 parents feeb679 + 57ff177 commit 7c4371c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

examples/TheThingsMessage/Receive/Receive.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ devicedata_t data = api_DeviceData_init_default;
1717

1818
void setup()
1919
{
20-
pinMode(TTN_PIN_LED, INPUT);
20+
pinMode(LED_BUILTIN, INPUT);
2121

2222
loraSerial.begin(57600);
2323
debugSerial.begin(9600);
@@ -41,7 +41,7 @@ void setup()
4141
void loop()
4242
{
4343
// Read sensors
44-
data.motion = digitalRead(TTN_PIN_LED) == HIGH;
44+
data.motion = digitalRead(LED_BUILTIN) == HIGH;
4545
data.water = 682;
4646

4747
// Encode data
@@ -63,4 +63,4 @@ void message(const uint8_t *payload, size_t length, port_t port)
6363
appdata_t appData = api_AppData_init_default;
6464
TheThingsMessage::decodeAppData(&appData, payload, length);
6565
}
66-
}
66+
}

src/TheThingsMessage.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ bool TheThingsMessage::decodeAppData(appdata_t *receiveData, const byte *payload
1010
{
1111
return false;
1212
}
13-
receiveData->light ? digitalWrite(TTN_PIN_LED, HIGH) : digitalWrite(TTN_PIN_LED, LOW);
13+
#ifdef LED_BUILTIN
14+
receiveData->light ? digitalWrite(LED_BUILTIN, HIGH) : digitalWrite(LED_BUILTIN, LOW);
15+
#endif
1416
return true;
1517
}
1618

src/TheThingsMessage.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
#include "deviceData.pb.h"
1212
#include "appData.pb.h"
1313

14-
#define TTN_PIN_LED LED_BUILTIN
15-
1614
typedef api_DeviceData devicedata_t;
1715
typedef api_AppData appdata_t;
1816

0 commit comments

Comments
 (0)