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:
prjh
2020-08-18 09:25:36 +08:00
committed by GitHub
parent 999adb395d
commit c7dc8e2efa
2 changed files with 10 additions and 6 deletions
+4 -3
View File
@@ -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();