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: X_NUCLEO_IKS01A1 MLX90614 d7a_1x wizzi-utils
Fork of D7A_1x_demo_sensors_OS5 by
Diff: main.cpp
- Revision:
- 9:25180d6a4c3a
- Parent:
- 8:01f0225408cf
- Child:
- 10:3d3dfc12f674
- Child:
- 12:6a1158950a9e
diff -r 01f0225408cf -r 25180d6a4c3a main.cpp
--- a/main.cpp Fri Feb 03 14:36:58 2017 +0000
+++ b/main.cpp Mon Feb 06 10:05:25 2017 +0000
@@ -38,6 +38,16 @@
#include "DebouncedInterrupt.h"
#include "files.h"
+// -----------------------------------------------
+// TARGET Options
+// -----------------------------------------------
+#if defined(TARGET_STM32L152RE)
+ // Enable this if a IKS01A1 shield is connected
+ // #define TARGET_HAS_IKS01A1
+#elif defined(TARGET_STM32L432KC)
+ // Enable this if WISENSE2 is populated with LSM303C (instead of LSM303AGR)
+ #define TARGET_HAS_LSM303C
+#endif
#if defined(TARGET_STM32L152RE)
@@ -111,7 +121,7 @@
// Hardware I/O
// -----------------------------------------------
AnalogIn g_light_meas(SENSOR_LIGHT_MEAS);
- DigitalOut g_light_en(SENSOR_LIGHT_EN);
+ DigitalOut g_light_en_l(SENSOR_LIGHT_EN);
#else
#error "Please choose or add the right platform."
@@ -454,10 +464,10 @@
return simul_sensor_value(buf, 1, 0, 100);
#elif (_LIGHT_EN_ == 1)
float tmp;
- g_light_en = 0;
+ g_light_en_l = 0;
Thread::wait(10);
tmp = g_light_meas;
- g_light_en = 1;
+ g_light_en_l = 1;
buf[0] = float2_to_int(tmp);
return false;
#else
@@ -664,7 +674,8 @@
#if defined(TARGET_STM32L152RE)
// xxx
#elif defined(TARGET_STM32L432KC)
- g_light_en = 1;
+ // Disable light sensing
+ g_light_en_l = 1;
#else
#error "Unsupported target"
#endif
