Is there a deep sleep mode for Fire?
-
Hello all,
I'm designing a Fire application which is supposed to be work on battery, and it will be beneficial if I can deep sleep Fire when it's not being used. Is there a way to "Sleep" the unit? Or what's the most common way to reduce power consumption?
Thank you!
-
Hello @houkensjtu
yes, there is. Two functions are available for that
POWER::lightSleep()
andPOWER::deepSleep()
Also have a look at the sleep example, it uses
light sleep
anddeep sleep
functionality.Cheers
Felix -
Hi Felix,
Thank you for you quick answer. Looks like you're referring to the Arduino library of M5Stack.
I wonder if there is an equivalent function in UI-FLOW? I'm currently using UI-Flow to program my Fire.
I can also try to burn the Arduino firmware, but I'm worried if I can control the UI as easily as in UI-Flow.Thx,
-
Hello @houkensjtu
ok, I see. In UI-FLOW you could use an
Execute code
block and add something like this for deep sleep:import machine #sleep for 10 seconds machine.deepsleep(10000)
or light sleep:
import machine #sleep for 10 seconds machine.lightsleep(10000)
BTW: I found a nice tutorial about MicroPython and sleep modes here.
Cheers
Felix