Editing Tutorial AutoRun
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | = [tl;dr] Autorun Code at Start-up | + | = [tl;dr] Autorun Code at Start-up |
− | the file named main.py will be run at start-up. Transfer your file onto the device with the name main.py and it will be executed the board is powered up. The [[Thonny | + | the file named main.py will be run at start-up. Transfer your file onto the device with the name main.py and it will be executed the board is powered up. The [[Thonny]] IDE also has a function to upload code as main.py directly |
= Run your MicroPyton code directly at Boot-up of ESP32/ESP8266 = | = Run your MicroPyton code directly at Boot-up of ESP32/ESP8266 = | ||
− | In this part of the tutorial, we talk about the boot process and how to start your own code at boot-up time. For this, we show how to use 'main.py' as | + | In this part of the tutorial, we talk about the boot process and how to start your own code at boot-up time. For this, we show how to use 'main.py' as entry point. We have an example how to use a Pin/switch to select whether to boot into your code or to not start a program. |
− | We also look at how to use the | + | We also look at how to use the uPyCraft IDE when autorun code, basically how to connect with Putty (or any terminal program) to remove main.py to be able to connect again with uPyCraft IDE. |
== Success criteria == | == Success criteria == | ||
− | * you understand | + | * you understand the boot process works (boot.py then main.py) |
* you have written some code and configured the ESP32 so that it is executed at boot time automatically | * you have written some code and configured the ESP32 so that it is executed at boot time automatically | ||
− | * you have written a main.py that allows | + | * you have written a main.py that allows to select whether to boot into your code or not |
== Required Module and Files == | == Required Module and Files == | ||
To enable autorun you have to create a file that is called 'main.py' that is in the main directory. There are different ways to do this: | To enable autorun you have to create a file that is called 'main.py' that is in the main directory. There are different ways to do this: | ||
* write the code you want to execute into the file main.py | * write the code you want to execute into the file main.py | ||
− | * write your code as a module that can be executed by calling a function. | + | * write your code as a module that can be executed by calling a function. call this function from main. |
== Related Components == | == Related Components == | ||
− | The components are related to the [[LMUBox]]. For more components, see the [[Hardware List]]. Many of the pages on actuators and | + | The components are related to the [[LMUBox]]. For more components, see the [[Hardware List]]. Many of the pages on actuators and sensor include additional examples. |
=== Microcontroller === | === Microcontroller === |