reprint Please specify: @ Xiao Wu Yi Http://www.cnblogs.com/xiaowuyi qq Group: 64770604
Python will be able to do hardware!
Before writing this tutorial, first feel Shandong Radish Electronic Technology Co., Ltd. (turnipsmart.tec.co,http://www.turnipsmart.com/) to provide technical support and Development Board support. The Micropython Development Board used in this tutorial is TPYBoardV102.
What is Micropython?
- Micropython is a python that can be run on a single-chip computer, which means you can develop a single-chip program in Python scripting language.
- Micropython complies with the MIT agreement for Open source, and the licensee has the right to reproduce, modify, distribute and re-authorize. Designed by George Daming, a theoretical physicist at Cambridge University. Similar to Arduino, but Micropython more powerful.
- Micropython based on Ansic, the syntax is basically consistent with Python3, with its own parser, compiler, virtual machine and class library. It currently supports 32-BIT-based ARM processors, such as stm32f405. That is to say, the ARM processor stm32f405 directly runs the Python language, using the Python language to control the microcontroller.
Second, what is Tpyboard-micropython?
- Tpyboard-micropython is a Micropython development Board made by Turnipsmart company based on Micropython licensed by MIT, which transmits data via USB interface on the basis of stm32f405 MCU. The board contains 4 LEDs, an acceleration sensor, which can operate at voltages between the 3v-10v.
- The Tpyboard-micropython Development Board allows users to easily control various peripherals of the microcontroller via Python code, such as LEDs, reading pin voltages, playing songs, networking with other devices, and more.
- The Tpyboard-micropython Development Board supports direct operation of Python3.0 and above, supports acceleration accelerometer, supports peripheral peripherals, and supports SWD to burn and write firmware. 0 Basic can also be flexibly mastered single-chip microcomputer technology!
Third, what can Tpyboard-micropython do?
Tpyboard through the Python scripting language to achieve the control of single-chip microcomputer, single-chip function to do what is equal to what tpyboard can do. Now that the Python language can control the microcontroller, is it possible to manipulate the robot? Or let's have a look at the single-chip function.
At present, single-chip microcomputer infiltration into all areas of our lives, it is almost impossible to find which field without the trace of single-chip microcomputer. Missile navigation device, aircraft on the control of various instruments, computer network communication and data transmission, industrial automation process of real-time control and data processing, a wide range of intelligent IC card, Civil Luxury car security system, video recorders, cameras, automatic washing machine control, as well as program-controlled toys, electronic pets and so on, These are inseparable from single-chip microcomputer. Not to mention robots, intelligent instruments, medical devices and various intelligent machines in the field of automatic control. Therefore, the SCM learning, development and application will create a group of computer applications and intelligent control of scientists, engineers. Single-chip microcomputer is widely used in instrumentation, household appliances, medical equipment, aerospace, special equipment, intelligent management and process Control areas, can be divided into the following categories:
1. Intelligent instrument
? Single-chip microcomputer has the advantages of small size, low power consumption, strong control function, flexible expansion, miniaturization and easy to use, widely used in instrumentation, combined with different types of sensors, can achieve such as voltage, current, power, frequency, humidity, temperature, flow, speed, thickness, angle, length, hardness, element, Measurement of physical quantities such as pressure. The use of single-chip microcomputer control makes the instrument digitization, intellectualization, miniaturization, and the function is more powerful than the use of electronic or digital circuits. such as precision measuring equipment (voltmeter, power meter, oscilloscope, various analyzers).
2. Industrial control
Single-chip microcomputer has the advantages of small size, strong control function, low power consumption, strong adaptability to environment, flexible expansion and easy to use, which can form various control systems, data acquisition system, communication system, signal detection system, wireless sensing system, measurement and control system, robot and other application control system. For example, the intelligent management of the factory assembly line, elevator intelligent control, a variety of alarm systems, and computer networking to form a two-level control system.
3. Household Appliances
Today's household appliances are widely used in single-chip microcomputer control, from rice cookers, washing machines, refrigerators, air conditioners, color TVs, other audio and video equipment, and electronic scale equipment and white goods and so on.
4. Network and communication
Modern single-chip microcomputer generally has communication interface, it can be conveniently connected with the computer data communication, for the application of computer network and communication equipment to provide excellent material conditions, now the communication equipment has basically realized the single-chip microcomputer intelligent control, from mobile phones, telephones, small-scale SPC, building automatic communication call system, Train wireless communication, and then to the daily work of ubiquitous mobile phones, trunking mobile communications, radio walkie-talkie and so on.
5. Medical equipment Field
The use of single-chip computer in medical equipment is also quite extensive, such as medical ventilator, various analyzers, monitors, ultrasound diagnostic equipment and hospital bed call system and so on.
6. Modular System
Some dedicated microcontroller designs are designed to implement specific functions, allowing for modular applications in a variety of circuits without requiring people to understand their internal structure. such as music integrated microcontroller, seemingly simple function, miniature in the pure electronic chip (different from the principle of the tape drive), it requires a complex computer-like principle. such as: music signal in the form of digital memory (similar to ROM), by the microcontroller readout, converted to analog music signal (similar to a sound card). In large circuits, this modular application greatly reduces the volume, simplifies the circuit, reduces damage, error rate, and facilitates replacement.
7. Automotive Electronics
Single chip microcomputer is widely used in automotive electronics, such as engine controller in automobiles, intelligent electronic Controller of automobile engine based on can bus, GPS navigation system, ABS anti-lock system, braking system, tire pressure detection, etc.
8, in addition, the SCM in the industry and commerce, finance, research, education, power, communications, logistics and defense aerospace and other fields have a very wide range of uses.
Iv. actual point, focus on the content
This tutorial will focus on the following:
1, Introduction tpyboardV102 how to use
2, tpyboardV102 Point LED light
3, tpyboardV102 control lcd5110 and LCD1602
4, tpyboardV102 control dot Matrix
5, tpyboardV102 use temperature sensor
6, tpyboardV102 use ultrasonic sensor
7, tpyboardV102 production of intelligent car
8, tpyboardV102 making metal Detector
9, tpyboardV102 production PM2.5 tester
[Tpyboard-micropython Tutorial 0] python will be able to do the hardware!