Send file data through D7A Action Protocol demo.
Dependencies: modem_ref_helper
sensor.cpp
- Committer:
- Jeej
- Date:
- 2017-05-11
- Revision:
- 0:3058da317f01
- Child:
- 5:4da1ea72e7b4
File content as of revision 0:3058da317f01:
#include "mbed.h" #include "hwcfg.h" #include "sensor.h" #include "WizziDebug.h" AnalogIn g_light_meas(SENSOR_LIGHT_MEAS); DigitalOut g_light_en_l(SENSOR_LIGHT_EN); uint8_t sensor_get_light(void) { uint8_t light_level = 0; // Enable light sensor g_light_en_l = 0; Thread::wait(10); // Read light value light_level = (uint8_t)(100*g_light_meas); // Disable light sensor g_light_en_l = 1; return light_level; }