:::
1. Arduino
(1) 各種 Arduino 控制板接腳
(2) D1 R32 pinout:https://bpb-ap-se2.wpmucdn.com/blogs.auckland.ac.nz/dist/9/698/files/2021/08/2_Pinout_D1_R32.png
D1 R32 參考文件:D1_R32_ENG.pdf
(3) 步進馬達
from machine import PWM, Pin
class Servo:
def __init__(self, pin, min=500, max=2400, range=180):
self.servo = PWM(Pin(pin), freq=50)
self.period = 20000
self.minDuty = self.__duty(min)
self.maxDuty = self.__duty(max)
self.unit = (self.maxDuty - self.minDuty)/range
def __duty(self, value):
return int(value/self.period * 1024)
def rotate(self, degree=90):
val = round(self.unit * degree) + self.minDuty
val = min(self.maxDuty, max(self.minDuty, val))
self.servo.duty(val)
2. 軟體工程師的 AI 工具
Copilot:https://copilot.microsoft.com/
ChatGPT:https://chatgpt.com/
推薦給軟體工程師的 AI 工具:https://www.explainthis.io/zh-hant/pinthis/blog/swe-ai-tools
使用範例:
(1) 在 esp8266 d1 上用 micropython 點亮一個 LED
(2) 在 esp8266 d1 上用 micropython 控制一個 LED閃爍