Put M5.shutdown in Void loop -keeps shutting down
-
I was trying to add a button to an Arduino sketch to shutdown unit. I messed up and put M5.shutdown in the Void loop as a separate statement. Now when I power it on it immediately shuts down. The M5 burner program won't erase it since it can't find the COM port since the power keeps shutting off. Is there any way to erase the Arduino code in memory without having to turn the unit on? I thought I could disconnect the battery but it is soldered to the board.
-
Hello @TrentD
try forcing the M5Core2 into download mode. Connect a wire from GPIO0 to GND, connect M5Core2 via USB to PC, then press the reset button. The COM port should now show up and stay. Now try to erase or download new firmware.
Thanks
Felix -
Thanks for the quick response. I bought this a few days ago so am not familiar with the pins. The pin map shows 3 GND pins in the left column in the first 3 rows and 2 GPIO pins side by side in row 11 but no GPIO0 pin. Can I use either GPIO pins?
Thanks
Trent -
Hello @TrentD
GPIO0 is labeled G0 (row 12) on the sticker, sorry about that. Connect GND (any of the three) with G0.
BTW: GPIO stands for General Purpose Input Output.
Thanks
Felix -
Felix,
It worked! Thank You so much! I thought I made the most expensive Lego brick in the world! HA HA. In all my years playing with the UNO I never found a way of shutting down through code. If I did I might of given up on IOT.
Thanks,
Trent