In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of "what are the advantages of Micropython". The editor shows you the operation process through actual cases, and the operation method is simple, fast and practical. I hope this article "what are the advantages of Micropython" can help you solve the problem.
1. Compiling environment
C language and assembly language need to download the compilation environment before writing the program, but Micropython does not need any compilation environment. Just insert the U port of the development board into the computer, and a drive character can appear on the computer, which is similar to inserting the U disk. Then open the U disk and edit the main.py directly. Its comfort is that MicroPython does not need any tools and environment, and any text tool + 1 development board can develop and compile. You can give it a nickname-pocket programming computer. Domestic do better is TPYBoard v102 development board, interested can go to learn about it, it has complete materials, video learning materials, or good, this is how I entered the pit.
two。 Operation difficulty
The basic operation of assembly language is simple, but it is relatively difficult to achieve complex project goals, the code is lengthy, and it is difficult to debug errors; C language has statements and a large number of library functions, which is relatively easy to assemble; MicroPython has more library functions than C, the code format is not only concise, under the support of the library, many functions and methods do not have to write by yourself, directly import xx can import the class library on ok. It used to take five or six lines of code to light a lamp, but now it only takes one line of code to light up the LED,So Easy.
3. Program structure
The assembly language generally uses the jump structure, whether it is the call of the subroutine or loop or scatter. Theoretically, the operation of interrupting or forcing out of the program segment needs to have precise control over the stack, and the requirements are very strict. C language generally uses loop structure or sequential structure, which no longer needs to jump everywhere to execute programs, interrupt operations will automatically press the stack without human intervention, and assembly can be embedded to improve efficiency when timing requirements are high. MciroPython can use C program structure or thread structure. Thread structure requires strict and reasonable allocation of thread working time, no conflict, good control of resources, and no waste of resources. In theory, multiple threads can run more efficiently. Although a single core can only run a single thread at the same time, it is synchronous from a macro point of view. When the time requirement is not strict, it can effectively reduce the difficulty of writing the program.
4. Way of writing
In the case of assembly without macros, it is usually an instruction direct operation unit, which needs to remember a large number of data units, and because of the large number of program lines (perhaps to one or two thousand lines), you need to go back and forth through the program code. the whole writing process is cumbersome. And because the complex data operations of all 8-bit units need to be completed by nested C language; any variable used in C language needs to be defined first, compared with not having to memorize the variable name deliberately, the overall structure is clear and most programming software has the function of jumping rotor program, so it is very convenient to find program blocks. There are a large number of finished product header files containing a variety of commonly used functions, relatively less a lot of complex programming; MicroPython inherits the advantages of C writing, and does not need to be predefined, does not need any ending symbols, just need a new line to continue to write, but to pay attention to the use of Tab key in some special cases.
5. Readability
The assembly itself is difficult to read because there are few tags and direct operation units, the visual structure is not only two columns of code, but also need to constantly jump, so it is very difficult to read; C language simple operation code is relatively clear, but complex will find the method, a lot of complex code is not to find, it makes people feel very headache MicroPython is more readable than C, and because it cancels a lot of special symbols, the overall feeling is relatively clear, many methods are written into a separate library, can be directly called, each function has a separate class library, which looks extremely convenient and clear at a glance.
This is the end of the content about "what are the advantages of Micropython". Thank you for your reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.