Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed Chainable_RGB_LED DigitDisplay LoRaWAN-lib SX1276Lib
Fork of DSP_LoRaWAN by
Revision 3:042ccdf1dd92, committed 2016-07-18
- Comitter:
- spcores
- Date:
- Mon Jul 18 17:58:40 2016 +0000
- Parent:
- 2:66f94cef0765
- Child:
- 4:fc21b1bd6b15
- Commit message:
- Update code: From Multicolored LED to Green LED Light
Changed in this revision
| app/main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/app/main.cpp Thu Apr 21 10:17:28 2016 +0000
+++ b/app/main.cpp Mon Jul 18 17:58:40 2016 +0000
@@ -19,7 +19,6 @@
#include "LoRaMac.h"
#include "Comissioning.h"
#include "SerialDisplay.h"
-#include "ChainableLED.h"
#define SEMTECH_BC_APP 0 //1 : Use Semtech Bootcamp Application
@@ -33,9 +32,9 @@
#define OVER_THE_AIR_ACTIVATION_DUTYCYCLE 10000000 // 10 [s] value in us
/*!
- * Defines the application data transmission duty cycle. 60s, value in [us].
+ * Defines the application data transmission duty cycle. 15s, value in [us].
*/
-#define APP_TX_DUTYCYCLE 3000000
+#define APP_TX_DUTYCYCLE 15000000
/*!
* Defines a random delay for application data transmission duty cycle. 1s,
@@ -58,7 +57,7 @@
*
* \remark Please note that when ADR is enabled the end-device should be static
*/
-#define LORAWAN_ADR_ON 0
+#define LORAWAN_ADR_ON 1
#if defined( USE_BAND_868 ) || defined( USE_BAND_865 )
@@ -205,13 +204,8 @@
**/
InterruptIn buttonPressed(D8);
-/*!
- * Constructor for the 3-color LED
- */
-#define NUM_LED 3
-ChainableLED color_led(D6, D7, NUM_LED);
-
-#define LIGHT_LEVEL 250 //0 : LED OFF | 250 : Bright White Light
+/* Green LED Lamp Output Definition */
+DigitalOut myGreenLed ( D6 );
uint8_t buttonCount = 0;
@@ -227,14 +221,14 @@
{
//Lights ON
ledStatus=1;
- color_led.setColorRGB(0, LIGHT_LEVEL, LIGHT_LEVEL, LIGHT_LEVEL);
+ myGreenLed=1;
}
else
{
//Lights OFF
ledStatus = 0;
- color_led.setColorRGB(0, 0, 0, 0);
+ myGreenLed = 0;
}
}
@@ -693,14 +687,14 @@
{
//Lights ON
ledStatus=1;
- color_led.setColorRGB(0, LIGHT_LEVEL, LIGHT_LEVEL, LIGHT_LEVEL);
+ myGreenLed = 1;
}
else
{
//Lights OFF
ledStatus = 0;
- color_led.setColorRGB(0, 0, 0, 0);
+ myGreenLed = 0;
}
break;
@@ -709,7 +703,8 @@
LightMode = McpsIndication->Buffer[0];
if( LightMode )
{
- color_led.setColorRGB(0, McpsIndication->Buffer[1], McpsIndication->Buffer[2], McpsIndication->Buffer[3] );
+ myGreenLed = 1;
+ //color_led.setColorRGB(0, McpsIndication->Buffer[1], McpsIndication->Buffer[2], McpsIndication->Buffer[3] );
}
break;
