This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
esp8266_power_usage [2015/06/23 19:33] tytower [7.system_deep_sleep_set_option] |
esp8266_power_usage [2016/07/05 18:38] (current) tumik Fixed formatting |
||
---|---|---|---|
Line 29: | Line 29: | ||
There is a modification to be made – both in hardware and software – to get current consumption low. On the firmware end, the Espressif SDK has made a ''system_deep_sleep([uint32_t time_in_us])'' function available, which puts the ESP8266 to sleep for a specified number of microseconds. When it wakes up, it begins running the user program from the very beginning. If you’re using the ESP8266 Arduino IDE, they’ve wrapped that function and another into a very nice ''ESP.deepSleep([microseconds], [mode])'' function. Here’s a quick example Arduino sketch for the ESP8266 that blinks the on-board LED 10 times, sleeps for 60 seconds, then repeats. | There is a modification to be made – both in hardware and software – to get current consumption low. On the firmware end, the Espressif SDK has made a ''system_deep_sleep([uint32_t time_in_us])'' function available, which puts the ESP8266 to sleep for a specified number of microseconds. When it wakes up, it begins running the user program from the very beginning. If you’re using the ESP8266 Arduino IDE, they’ve wrapped that function and another into a very nice ''ESP.deepSleep([microseconds], [mode])'' function. Here’s a quick example Arduino sketch for the ESP8266 that blinks the on-board LED 10 times, sleeps for 60 seconds, then repeats. | ||
<code> | <code> | ||
+ | |||
#include <Ticker.h> // Ticker can periodically call a function | #include <Ticker.h> // Ticker can periodically call a function | ||
Ticker blinker; // Ticker object called blinker. | Ticker blinker; // Ticker object called blinker. | ||
Line 61: | Line 62: | ||
===== More data from expressif ===== | ===== More data from expressif ===== | ||
- | can be found at \\ [[http://bbs.espressif.com/download/file.php?id=253&sid=398301f84155a628a3a39725226e7379|http://bbs.espressif.com/download/file.php?id=253&sid=398301f84155a628a3a39725226e7379]] | + | can be found at \\ [[http://bbs.espressif.com/download/file.php?id=253&sid=398301f84155a628a3a39725226e7379|http://bbs.espressif.com/download/file.php?id=253&sid=398301f84155a628a3a39725226e7379]]// |
+ | [[http://bbs.espressif.com/viewtopic.php?f=21&t=645|http://bbs.espressif.com/viewtopic.php?f=21&t=645]]// | ||
An extract from which deals with deep sleep \\ | An extract from which deals with deep sleep \\ | ||
Line 85: | Line 87: | ||
**__Note:__** \\ Init data refers esp_init_data_default.bin.\\ | **__Note:__** \\ Init data refers esp_init_data_default.bin.\\ | ||
**__Return:__**\\ | **__Return:__**\\ | ||
- | true : succeed........ false : fail\\ | + | true : succeed........ false : fail // |
- | + | | |
- | == And some more == | + | |
- | [[http://bbs.espressif.com/viewtopic.php?f=21&t=645|http://bbs.espressif.com/viewtopic.php?f=21&t=645]] |