![]() There is one minor problem with MicroPython on the ESP32 that we will address in this experiment: if your code includes a forever loop, the MicroPython interpreter will continue to run your code (forever!), which means we never get a REPL prompt. This time, we are going to show two examples: how to respond to a button press and how to blink the onboard LED by writing code in a text editor and uploading that file to the ESP32. In the REPL section, we saw how to control an LED by individually calling commands in the REPL. To do that, follow the steps outlined in the How to Load MicroPython on a Microcontroller Board (specifically, the steps found in the ESP32 Thing section). To run MicroPython on the ESP32, you will need to first load the interpreter on it. ![]() Unfortunately, the ESP32 Thing does not come ready to run MicroPython programs out of the box. Some recommended text editors that work well for writing code include: As a result, you will need to write code in a raw text editor and then save the files as somename.py. At the time of this writing, no major integrated development environments (IDEs) support MicroPython for the ESP32 (for example, Mu was developed for MicroPython but does not support the ESP32). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |