Home  >  Article  >  Backend Development  >  Can python be embedded?

Can python be embedded?

(*-*)浩
(*-*)浩Original
2019-07-06 11:28:037044browse

Python has become very popular in recent years. Python is an object-oriented interpreted computer programming language. Python syntax is concise and clear, easy to read and scalable. Python has rich and powerful libraries that can be used in other languages. The various modules produced (especially C/C) are easily connected together and are often called glue languages. They can be used in graphics processing, mathematical processing, Web programming, multimedia applications and other fields.

Can python be embedded?

##Positioning (Recommended learning: Python video tutorial)

For such a long time in the past, the development language in the field of embedded development has been mainly C/C. Now MicroPython based on Python has been involved in this field. MicroPython is an engineer named Damien George. Based on ANSI C (C language standard), and then following the Python specifications in terms of syntax, mainly to make it easier to implement underlying operations on embedded hardware (specifically the microcontroller level here), The hardware development board officially provided by MicroPython is called PyBoard. In addition to the officially provided development board, some embedded hardware has also been successfully transplanted with MicroPython, such as: Esp8266, WiPy, Espruino Pico, STM32F4 Discovery, etc.

MicroPython pyboard is a compact electronic circuit board that runs MicroPython on bare metal, giving you a low-level Python operating system that can be used to control a variety of electronic projects.

MicroPython includes many advanced features such as interactive prompts, arbitrary precision integers, closures, list comprehensions, generators, exception handling, etc. However it is very compact, running in 256k of code space and 16k of RAM.

MicroPython is designed to be as compatible as possible with regular Python so you can easily transfer code from your desktop to a microcontroller or embedded system.

pyboard is the official MicroPython microcontroller board that fully supports software functions. The hardware is:

STM32F405RG microcontroller

168 MHz Cortex M4 CPU with hardware floating point

1024KiB Flash ROM and 192KiB RAM

Micro USB Connector for power and serial communication

Micro SD card slot, supports standard and high-capacity SD cards

3-axis accelerometer (MMA7660)

With optional Select the battery-backed real-time clock

The left and right edges are 24 GPIO, the bottom row is 5 GPIO, and there are LED and switch GPIO at the bottom

3 12-bit analog-to-digital converters, 16 pins pins, 4 analog ground shields

2x 12-bit analog-to-analog converters (DAC), available on pins X5 and X6

4 LEDs (red, green, yellow and blue Color)

1 reset and 1 user switch

Onboard 3.3V LDO regulator, capable of supplying up to 250mA, input voltage range is 3.6V to 16V

The DFU bootloader in ROM can easily upgrade the firmware

Python is a language that is very easy to get started and is also a widely used language. MicroPython brings this language that is easy to learn and use to embedded During development, you can directly operate the hardware without compiling or downloading. You can quickly see the results of the program, which is a very good experience. PyBoard is a beautiful development board that is exquisite and compact, making it easy to learn and develop. In addition, MicroPython also supports more platforms, such as: STM32F4 Discovery Board, NUCLEO-F401RE Board, NUCLEO-F767ZI Board, ESP8266, WiPy, etc., the above All development boards can support MicroPython. You can use it by flashing the firmware on the development board. MicroPython brings a new development experience. Interested students can try it.

For more Python related technical articles, please visit the

Python Tutorial column to learn!

The above is the detailed content of Can python be embedded?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn