The first Micropython graphical editor—Python Editor

   When you read this article, obviously you have read a lot of similar articles, so this article will explain some newbie needs in depth and provide detailed advice, of course I will not tell you how to do it, all the answers are is superficial. For myself, the initial exposure to programming is a mixture of excitement and pain. It's exciting to watch the code you type by hand, but it's very painful due to mistakes in formatting, indentation, code rules, etc. So what this article introduces is an editor to avoid novice programming errors, the Python Editor based on the Micropython language editor of the TPYBoard series of development boards.                                                                                                                              

First, let's take a look at the programming interface of the python editor: introduction to programming interface functions, which I will explain below.

URL: http://www.tpyboard.com/pythoneditor/#

      To be honest, when I saw the teaching of interlocking programming, the first impression in my mind was the interlocking of Lego blocks. For the children of five or six years old who just had self-awareness, the interlocking of Lego blocks was very successful. It is recognized as a very good simple toy to inspire the intelligence of infants and young children. But he is only a toy that inspires the intellect and recognizes the world. As children continue to grow, simple building blocks can no longer satisfy their desire for knowledge. They are eager for deeper knowledge and naturally come into contact with program codes. Moreover, children are more so, not to mention more curious. Strong adults.

What is the TPYBoard development board?

Continue to look back at the python editor. This editor is a Micropython language editor based on the TPYBoard v10x series development board. What is the TPYBoard development board? TPYBoard uses the stm32 main chip, and this development board can be directly connected to the PC for programming.

Just look at the specifications of the development board without going into details.

 

MCU (main control chip)

stm32f405rgt6

RAM

Flash: 1024KB RAM: 192KB

storage support

SD Card (up to 8GB)

power supply

Micro USB, can work within 3.5V-10V

USB port

2x USB 2.0

button

RST key: below the Micro USB port

USR key: next to the RST key

LED

LED*4 (from the chip outwards are red, yellow, green, blue)

OS (= firmware)

TPYBoardV10X

size

64mm x 54mm

weight

17g

interface

GPIO(30) SPI(2) CAN(2) I2C(2) USART(5) ADC(12) DAC(2) SWD(1)

hardware resources

3-axis accelerometer (MMA7660)

LED*4 (from the chip outwards are red, yellow, green, blue)

1 TF card slot

2 buttons

Python Editor

Taking a simple timer as an example, the complete code is as follows:

When the graphics are inserted, the system will automatically generate Micropython code based on the graphics and display them in the right area, without considering the format and indentation. As long as you master the principle of graphic interpolation, the code will be completely correct.

TPYBoard development board running program

Click download python in the lower left corner of the python editor, and download the code generated by the system to the TPYBoard drive letter TPYBFLASH to run the program.

Of course, for friends who want to know how to learn programming with zero basics, most of them have no foundation, and even if they have, it is irrelevant, let alone the foundation of development. Although it is mentioned above that the python editor editor does not need any foundation, but if you want to use it well, it is not something that can be achieved on paper. Practice is the only criterion for testing the truth!

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324664221&siteId=291194637