本实验基于
Thonny
平台
http://152.32.187.208:8080/yd-data/YD-RP2040/
本实验YD-RP2040开发板所烧录的固件:
Pimoroni Pico LiPo
https://circuitpython.org/board/pimoroni_picolipo_16mb/
Raspberry Pi Pico
源地YD-RP2040选择的是16MB容量的flash型号的,所以在匹配烧录固件时,推荐选择
Pimoroni Pico LiPo
的固件。
CircuitPython
:(CircuitPython基于MicroPython, 由Adafruit赞助, 并为Adafruit出品的教育开发板进行了移植)https://micropython.org/download/?vendor=Pimoroni
Raspberry Pi Pico:
: https://micropython.org/download/?vendor=Raspberry%20Pi
MicroPython
代码from machine import Pin, Timer
led = Pin(25, Pin.OUT)
timer = Timer()
def blink(timer):
led.toggle()
print("Hello RP2040 PI Pico")
timer.init(freq=2.5, mode=Timer.PERIODIC, callback=blink)
CircuitPython
闪灯控制代码import board
import time
import digitalio
#工作状态指示灯(板载自带LED GP25)
Work_LED = digitalio.DigitalInOut(board.GP25)# 初始化引脚25作为LED的控制引脚
Work_LED.switch_to_output(value=False, drive_mode=digitalio.DriveMode.PUSH_PULL)# 引脚为输出,并定义初始值为0
while True:
Work_LED.value = 1 - Work_LED.value
time.sleep(1)
print('hello world')