Here it is ...
Dependencies: libxDot-mbed5 TSL2561
Fork of Dot-Examples by
Diff: examples/src/ota_example.cpp
- Revision:
- 40:314e6b1c289f
- Parent:
- 39:0d4362063352
--- a/examples/src/ota_example.cpp Thu Jul 26 12:03:47 2018 -0400 +++ b/examples/src/ota_example.cpp Mon Jul 30 08:51:08 2018 -0400 @@ -26,12 +26,12 @@ ///////////////////////////////////////////////////////////// // wifi gateway -//static std::string network_name = "MTCDT-19400691"; -//static std::string network_passphrase = "MTCDT-19400691"; +static std::string network_name = "MTCDT-19400691"; +static std::string network_passphrase = "MTCDT-19400691"; // cellular gateway -static std::string network_name = "iuiot-gw1"; -static std::string network_passphrase = "pivotiot"; +//static std::string network_name = "iuiot-gw1"; +//static std::string network_passphrase = "pivotiot"; static uint8_t network_id[] = { 0x6C, 0x4E, 0xEF, 0x66, 0xF4, 0x79, 0x86, 0xA6 }; @@ -47,7 +47,7 @@ // in deepsleep mode, IOs float, RAM is lost, and application will start from beginning after waking up // if deep_sleep == true, device will enter deepsleep mode static bool deep_sleep = false; -static const uint16_t HOURLY_SLEEP_INTERVAL = 3600; // 1 hour +static const uint16_t HOURLY_SLEEP_INTERVAL = 5; // 1 hour *** changed for demo 1 min static const uint16_t DAILY_SLEEP_INTERVAL = 43200; // 12 hours mDot* dot = NULL; @@ -74,6 +74,8 @@ wait(1); } + // set gain on light sensor + lightSensor.set_timing_reg(TIMING_GAIN_16); mts::MTSLog::setLogLevel(mts::MTSLog::TRACE_LEVEL); @@ -230,8 +232,8 @@ counter = 0; pc.printf("deleted tx_data and reset counter\r\ncap: %d size: %d\r\n", tx_data.capacity(), tx_data.size()); - // sleep for the day - sleep_wake_rtc_only(deep_sleep, DAILY_SLEEP_INTERVAL, &pc); + // sleep for the day *** don't want to sleep for 12 hours for the demo + //sleep_wake_rtc_only(deep_sleep, DAILY_SLEEP_INTERVAL, &pc); }