mdot UDK & STMicro MEMS Shield Sensor packet example

Dependencies:   libmDot-mbed5 DOGS102 ISL29011 MMA845x MPL3115A2 NCP5623B X_NUCLEO_IKS01A1 Senet_Packet

Fork of MTDOT-UDKDemo_Senet by canuck lehead

Branch:
develop
Revision:
39:022b327d6bf0
Parent:
36:cd1077f40dbf
Child:
43:55e7bb4d9b60
--- a/main.cpp	Tue Aug 29 16:38:13 2017 -0400
+++ b/main.cpp	Tue Aug 29 18:05:34 2017 -0400
@@ -191,7 +191,7 @@
 
 	} while(ok == false);
 
-	joinTicker.attach(joinLedToggle,1);
+	joinTicker.attach(joinLedToggle, 5);
 
 	// attempt to join the network
 	printf("joining network\r\n");
@@ -205,7 +205,7 @@
 	printf("network joined\r\n");
 
 	joinTicker.detach();
-	appLED=1;
+	CBoard::SetLED(1, false);
 }
 
 void SendFrame()
@@ -293,6 +293,7 @@
 		if( ( BackendSynchronized == true )  &&  ( getNextTxOrientation(txOrientation) < Orientation_Max ) )
 		{
 			BackendSynchronized = false;
+			CBoard::SetLED(1, true);
 
 			// Get elapsed time since last transmit
 			time_t currT    = time(NULL);
@@ -342,6 +343,9 @@
 				nextTxTimer.detach();
 				nextTxTimer.attach_us(onNextTxTimerEvent, AppTxDutyCycle * 1e3);
 			}
+
+			if(BackendSynchronized == true)
+				CBoard::SetLED(1, false);
 		}
 
 		// Delay before next sensor poll
@@ -358,5 +362,6 @@
     printf("%s - %ld:%s, %s\r\n", msg, retval, mDot::getReturnCodeString(retval).c_str(), dot->getLastError().c_str());
 }
 
-void joinLedToggle() { appLED= !appLED; }
+void joinLedToggle() { CBoard::ToggleLED(1); }
+
 void onNextTxTimerEvent( void ) { NextTx = true; }