AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Thonny python8/19/2023 ![]() ![]() Thonny was introduced in 2015 by Aivar Annamaa of the University of Tartu in Estonia. To upload MicroPython script to your device, go to Files and click on ‘Save as’. Bill was using Thonny, a Python IDE that is popular in the education community. That means we can also directly upload files to a device. This gives two options to save this file either to your computer or directly to your devices such as ESP32 or ESP8266. When you click on the save icon (2), this pop-up window will appear. After that copy the following code in a new file and save it by clicking the save icon (2) with the name main.py. To create a new file click on the new file icon (1). For demonstration, we will perform a simple experiment of blinking onboard LED of ESP32 and ESP8266 by following all the necessary steps Create MicroPython File in Thonny IDEįirst, we need to create a main.py file that will contain our main program code which would be executed. In this section, we will see how to create a new MicroPython file and how to upload the script to ESP32/ESP8266 using Thonny IDE. Writing Your First MicroPython Script with Thonny IDE You can tick all the tabs which you want to appear on your IDE. Click on any to customize your IDE according to your needs. By clicking this, the program code halts whichever line it currently is. It allows us to go back into play mode instead of debug mode. With this button, we can exit the debugging. This arrow button (Step Out) is also used after the debug button.With this button, we take a smaller step than the previous button and work deeply. This arrow button (Step Into) is used after the debug button.With this button, we can jump from one line or one block of code to another. This arrow button (Step Over) is used after the debug button.This helps us in detecting errors whether they are syntax or logical When we click on it the code runs and is executed. By clicking on this icon we can save our code in whatever step it is. It helps us in opening a file which was already saved in our PC. By using this button, we can create several different files and work on them at once. The first icon which shows a paper is for creating a New File.I will describe them in order of the numbers. The tools section has several different tools with different functionalities. It also displays all the errors encountered in the code as well as the state of the connection clearly. Immediate execution is achieved through this. Through this, we can give the command to the ESP board without (writing, saving, uploading) it in a separate file. The Shell section is found at the bottom. py files and can open several files at once and work on them. You can think of this light-blue box as a piece of paper where Python replaces subexpressions with their values, piece-by-piece.The Editor section is found at the top half of the screen. ![]() If you use small steps, then you can even see how Python evaluates your expressions. ![]() ![]() Steps follow program structure, not just code lines. Press F6 for a big step and F7 for a small step. Just press Ctrl+F5 instead of F5 and you can run your programs step-by-step, no breakpoints needed. Once you’re done with hello-worlds, selec t View → Variables and see how your programs and shell commands affect Python variables. I am going to demo a few features (the following text is from the Thonny homepage ) No-hassle variables. It has a lot of cool features that you may find useful. Thonny is a Python IDE for beginners, it has Python built in so no need for a seperate install. I know that some of you have struggled to get Python working at home, so let me introduce you to Thonny. ![]()
0 Comments
Read More
Leave a Reply. |