"Sensors Reader" Sample Application for X-NUCLEO-IKS01A1 Expansion Board

Dependencies:   X_NUCLEO_IKS01A2 mbed

Fork of Sensors_Reader by ST

Revision:
4:81037ace7f27
Parent:
3:c35414b03a65
Child:
5:a1de9dcb0f41
--- a/main.cpp	Mon Apr 20 11:42:38 2015 +0200
+++ b/main.cpp	Fri Apr 24 09:57:03 2015 +0200
@@ -66,6 +66,13 @@
 /*** Macros ------------------------------------------------------------------- ***/
 #define APP_LOOP_PERIOD 1300 // in ms
 
+#if defined(TARGET_STM)
+#define LED_OFF (0)
+#else
+#define LED_OFF (1)
+#endif
+#define LED_ON  (!LED_OFF)
+
 
 /*** Typedefs ----------------------------------------------------------------- ***/
 typedef struct {
@@ -85,7 +92,8 @@
 static X_NUCLEO_IKS01A1 *mems_expansion_board = X_NUCLEO_IKS01A1::Instance();
 static Ticker ticker;
 static volatile bool timer_irq_triggered = false;
-static DigitalOut myled(LED1);
+static DigitalOut myled(LED1, LED_OFF);
+
 
 /*** Helper Functions (1/2) ------------------------------------------------------------ ***/
 
@@ -137,7 +145,7 @@
 	char buffer3[32];
 
 	/* Switch LED On */
-	myled = 1;
+	myled = LED_ON;
 	printf("===\n");
 
 	/* Determine Environmental Values */
@@ -161,7 +169,7 @@
 	       GYR_Value.AXIS_X, GYR_Value.AXIS_Y, GYR_Value.AXIS_Z);
 	
 	/* Switch LED Off */
-	myled = 0;
+	myled = LED_OFF;
 }