Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
5 years ago.
mDot: "deep sleep" mode
I have a few questions...
I've been using mDot_DS18B20 https://developer.mbed.org/teams/Thing-Innovations/code/mDot_DS18B20/ as a basis and making mods.
I'm trying to understand what the "sleep" mode is doing as called at the bottom of
I simplified the code (I have no temp sensor) and inserted in the message a simple int variable, count, and incremented it so that each time the mDot transmitted, it would send a different value. However, count is always =0.
So, it appears that the "sleep" mode being called forces the code to start from the beginning (reinitializing my count).
1) Is this true?
If so it appears the while() loop being used at the bottom of main.cpp is superfluous.
3) Where is this sleep functionality described and
4) what do you recommend I do about it - can I declare my variables differently, etc.?
5 years ago.
The mdot library is currently configured to put the mDot into a standby mode which makes sure all the peripherals are shut down. Also, the mDot is reset and doesn't retain the processor state including the variables. You can use the deepsleep() function provided by mbed to turnoff the controller preserving the state of your variables. See if that works for you.