程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

[micropython] learn python with esp32

編輯:Python

use ESP32 learn Python

One 、 Environment building

1、 Hardware platform

ESP32 Series of all right , Study 、 It is best to use the with expansion board in the test phase , You can also weld the core part by yourself .
What is used here is ESP32-C3 Series of modules , Anxinko's NodeMCU-ESP-C3-12F-Kit, You can find it by yourself

2、 software platform

Software can choose Thonny platform , It's easy to use . You can also use common putty Tools ,MU Development tools, etc
https://thonny.org/

3、 Firmware download machine burning

Here ESP32-S Screenshot of example
Firmware can be downloaded from MicroPython Official website Download , It is divided into ESP-IDF v3.x and ESP-IDF v4.x Two kinds of

Burning can use thonny perhaps esptools Burn

Burn successfully :

Two 、 Be familiar with the environment

Tools — Set up — Interpreter Configure the device and serial port number

1、REPL

Select a good serial port , After burning , You can see that MicroPython The startup output information of

3、 Light up a LED The lamp

With NODEMCU-32( The core is ESP32-S) For example
LED Lamp mounted on IO2 On the mouth

from machine Load... In the library Pin function
Set up 2 Pin is output
Use .on .off Output high level and low level

Use time Library sleep Function to sleep

from machine import Pin
Led=Pin(2,Pin.OUT)
import time
while True:
time.sleep(0.5)
led.on()
time.sleep(0.5)
led.off()

Use Ctrl+c You can exit the running state

appendix

1、 Reference website

https://www.cnblogs.com/JunRoinxxX/p/13477188.html
https://www.liaoxuefeng.com/wiki/1016959663602400

2、 Reference books

1、 Hypergraph Python The Internet of things
2、 Super simple Python/MicroPython Internet of things applications


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved