In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail what is the difference between CircuitPython and micropython, the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
CircuitPython
Native USB is supported on all boards, and files can be edited without special software.
Floating-point numbers (that is, decimals) are enabled in all versions.
Error messages are translated into more than 10 languages (Chinese is Pinyin).
Concurrency features (including interrupts and threads) in Python are not supported. For tasks that require it (such as audio file playback), the local module can achieve some concurrency.
Behavior
The order in which the files are run and the status of sharing between them. The goal of CircuitPython is to clarify the role of each file and to make each file independent of each other.
Boot.py (or settings.py) runs only once before the USB is initialized. This lays the foundation for configuring USB at startup rather than fixing it. Because the serial port is not available at this time, the output is written to the file boot_out.txt.
Code.py (or main.py) runs after each reload until it is completed or interrupted. After the run is complete, the virtual machine and hardware will be reinitialized. This means that you cannot read the code.py running status in REPL. The goal of circuittpython is to reduce confusion between pins and memory usage.
After the code.py has finished running, you can press any key to enter REPL. It no longer shares code.py state with REPL, so this is a new virtual machine.
The auto-load state is maintained throughout the reload process.
Add a safe mode that no longer runs user code after a hard crash or power outage. It is easier to repair code that causes a severe crash through mass storage after a crash. After repair, it is returned to normal mode by reset.
RGB LED indicates the CircuitPython status and indicates the circuit status and errors through different colors.
Rerun the code.py or other master file after the file is written to USB bulk storage. (disabled using supervisor.disable_autoreload ())
After the completion of the main code, you need to press the key to enter REPL and disable automatic loading.
The main program can be one of these files: code.txt, code.py, main.py, main.txt
The boot file can be one of these files: settings.txt, settings.py, boot.py, boot.txt
API
Unified hardware API. The document is on ReadTheDocs.
API documents are shared with C files in shared-bindings.
There is no machine API.
Module
No module alias. (uos and utime cannot be used as os and time, respectively. In contrast, os, time, and random are compatible with CPython.
The new storage module manages file system mounts. (from the function of uos in MicroPython)
The modules corresponding to CPython, such as time, os, and random, are strict subsets of the CPython version. As a result, CircuitPython's code can run on CPython, but not necessarily vice versa.
The time.monotonic () function is used for tick counters
About what the difference between CircuitPython and micropython is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.