Skip to content

Commit

Permalink
Merge pull request #200 from TheThingsNetwork/fix/led-builtin-dependency
Browse files Browse the repository at this point in the history
Removed dependency on LED_BUILTIN
  • Loading branch information
johanstokking authored Apr 18, 2017
2 parents feeb679 + 57ff177 commit 7c4371c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions examples/TheThingsMessage/Receive/Receive.ino
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ devicedata_t data = api_DeviceData_init_default;

void setup()
{
pinMode(TTN_PIN_LED, INPUT);
pinMode(LED_BUILTIN, INPUT);

loraSerial.begin(57600);
debugSerial.begin(9600);
Expand All @@ -41,7 +41,7 @@ void setup()
void loop()
{
// Read sensors
data.motion = digitalRead(TTN_PIN_LED) == HIGH;
data.motion = digitalRead(LED_BUILTIN) == HIGH;
data.water = 682;

// Encode data
Expand All @@ -63,4 +63,4 @@ void message(const uint8_t *payload, size_t length, port_t port)
appdata_t appData = api_AppData_init_default;
TheThingsMessage::decodeAppData(&appData, payload, length);
}
}
}
4 changes: 3 additions & 1 deletion src/TheThingsMessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ bool TheThingsMessage::decodeAppData(appdata_t *receiveData, const byte *payload
{
return false;
}
receiveData->light ? digitalWrite(TTN_PIN_LED, HIGH) : digitalWrite(TTN_PIN_LED, LOW);
#ifdef LED_BUILTIN
receiveData->light ? digitalWrite(LED_BUILTIN, HIGH) : digitalWrite(LED_BUILTIN, LOW);
#endif
return true;
}

Expand Down
2 changes: 0 additions & 2 deletions src/TheThingsMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
#include "deviceData.pb.h"
#include "appData.pb.h"

#define TTN_PIN_LED LED_BUILTIN

typedef api_DeviceData devicedata_t;
typedef api_AppData appdata_t;

Expand Down

0 comments on commit 7c4371c

Please sign in to comment.