mirror of
https://github.com/m5stack/M5Stack.git
synced 2026-09-17 00:30:10 -07:00
Fix M5.Power.powerOFF() exception bug (#225)
* Fix M5Power.powerOFF() exception bug, adapt related example to new Power-API. * wifi check better using esp_wifi_get_mode()
This commit is contained in:
@@ -14,15 +14,16 @@ void setup(){
|
||||
M5.Power.begin();
|
||||
|
||||
// Lcd display
|
||||
M5.Lcd.println("This is software power off demo");
|
||||
M5.Lcd.println("Press the button A to power off.");
|
||||
M5.Lcd.setTextSize(2);
|
||||
M5.Lcd.println("Software Power-OFF Demo");
|
||||
M5.Lcd.println("Press Button A ...");
|
||||
}
|
||||
|
||||
// the loop routine runs over and over again forever
|
||||
void loop() {
|
||||
|
||||
if(M5.BtnA.wasPressed()) {
|
||||
M5.powerOFF();
|
||||
M5.Power.powerOFF();
|
||||
}
|
||||
|
||||
M5.update();
|
||||
|
||||
Reference in New Issue
Block a user