Use LED to display join state
This commit is contained in:
@@ -44,7 +44,7 @@ AnalogIn bat(MBED_CONF_APP_BATTERY_ADC);
|
||||
DHT dht(MBED_CONF_APP_DHT_DATA, MBED_CONF_APP_DHT_TYPE);
|
||||
#endif
|
||||
|
||||
DigitalOut led(LED1);
|
||||
DigitalOut led(LED1, 1);
|
||||
|
||||
int main(void) {
|
||||
|
||||
@@ -78,6 +78,8 @@ int main(void) {
|
||||
|
||||
printf("\r\n Adaptive data rate (ADR) - Enabled \r\n");
|
||||
|
||||
led = 0;
|
||||
|
||||
retcode = lorawan.connect();
|
||||
|
||||
if (retcode == LORAWAN_STATUS_OK ||
|
||||
@@ -166,6 +168,7 @@ static void lora_event_handler(lorawan_event_t event)
|
||||
{
|
||||
switch (event) {
|
||||
case CONNECTED:
|
||||
led = 1;
|
||||
printf("\r\n Connection - Successful \r\n");
|
||||
if (MBED_CONF_LORA_DUTY_CYCLE_ON) {
|
||||
send_message();
|
||||
|
||||
Reference in New Issue
Block a user