Complete sensor demo.
Dependencies: modem_ref_helper CRC X_NUCLEO_IKS01A1 DebouncedInterrupt
Diff: sensors.cpp
- Revision:
- 6:c17f7cbdeb1a
- Parent:
- 2:cbe6dca8a632
- Child:
- 15:1271f3566b98
--- a/sensors.cpp Wed Sep 20 14:41:54 2017 +0000 +++ b/sensors.cpp Thu Sep 21 11:23:13 2017 +0000 @@ -335,14 +335,14 @@ bool light_get_value(int32_t* buf) { #if (_LIGHT_EN_ == 0) - return simul_sensor_value(buf, 1, 0, 100); + return simul_sensor_value(buf, 1, 0, 1000); #elif (_LIGHT_EN_ == 1) && defined(SENSOR_LIGHT_MEAS) && defined(SENSOR_LIGHT_EN) float tmp; g_light_en_l = 0; Thread::wait(10); tmp = g_light_meas; g_light_en_l = 1; - buf[0] = float2_to_int(tmp); + buf[0] = (int32_t)(tmp*1000); return false; #else return false;