Try   HackMD

MicroPython 同學會共筆

LHB阿好伯, 2022/05/29

tags: Micropython

參考書籍

超圖解Python 物聯網實作入門:使用 ESP8266 與 MicroPython

超簡單Python/MicroPython物聯網應用:堆積木寫程式輕鬆學習軟硬體整合

物聯網實戰(ESP32篇):使用樹莓派/NodeMCU-32S/Python/MicroPython/Node-RED打造安全監控系統

使用套件

【慧手科技】Micropython 共學材料

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

整合開發環境(IDE)

Thonny(編輯與燒錄)

https://swf.com.tw/?p=1477

下載網址

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

燒錄韌體

USBtoUART晶片

有些電腦第一次使用晶片時其中用於電腦與開發板通訊的CH340晶片
可能發生錯誤或是無驅動
這時需要安裝相關驅動
CH340驅動下載網址1

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

CH340驅動下載網址2

https://hackmd.io/_uploads/rysFeleO5.png

CP2102驅動下載網址

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

下載韌體

esp32下載網址

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

按住BOOT鍵見等待燒錄
約一分鐘即可完成
若第一次安裝無BOOT鍵並發生燒錄問題可參考1 元解決 ESP32 開發板無法全自動上傳問題

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

程式執行

顯示micropython檔案

micropython非常特別的地方在於寫入的程式碼都可以讀取出來修改

首先須先連接裝置

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

在Thonny中開啟檢視 -> 檔案

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

即可看到裝置中的程式碼

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

撰寫程式

LED閃爍

from machine import Pin import time #輸入控制時間的程式庫 led = Pin(2, Pin.OUT) #設定LED腳位慧手科技套件腳位 #led = Pin(22, Pin.OUT) #設定LED腳位 while True: led.on() time.sleep(1) #暫停(持續目前狀態1秒) led.off() time.sleep(1)

上傳

選擇執行程式至micropython裝置中

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

附檔名應為XXX.py
若存為main.py則會是裝置通電後自動執行的程式碼

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

micropython SSD1306使用紀錄

micropython SHT11使用紀錄

micropython WS2812使用紀錄

micropython 讀取ADC繪製歷史曲線(Line Plot)

micropython 網路連結 WiFi_Manager

Micropython NTP指針時鐘 OLED SSD1306

課程共享資料

益師傅程式碼

版本:20220602 ver-4

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

中文字庫

@陳瑞隆

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

適用於 MicroPython 和 ESP32 的 ntptime 模組

Paoyung ChangSun, Jun 12, 2022 0:52 AM

非阻斷式 DHT11 模組

@psoyung

2022/06/12分享資料

MQTT與SSD1306中文字庫應用

課程錄影

https://drive.google.com/drive/folders/1D-dp9PqiUqsGxgnlf5rgkQwNE-n-BedC

🌟全文可以至下方連結觀看或是補充

全文分享至

https://www.facebook.com/LHB0222/

https://www.instagram.com/ahb0222/

有疑問想討論的都歡迎於下方留言

喜歡的幫我分享給所有的朋友 \o/

有所錯誤歡迎指教

全部文章列表