首先感谢比派科技 & 电子发烧友提供的使用机会。
一、开箱&硬件介绍

`BPI-Pico-RP2040 是 Banana Pi 推出的一款搭载RP2040芯片的微控制器开发板,其最显著的特性是,在尽量保留Raspberry Pi Pico的功能,外形尺寸,引脚布局的前提下,增加一颗板载 WS2812 彩色LED;将 3-Pin DEBUG 接口替换为一个JST SH 1mm 4-Pin 插座,可与 Qwiic & STEMMA QT 或任何可能的外设连接。


二、MicroPython环境
(一)固件更新
BPI-Pico-RP2040板支持MicroPython、CircuitPython和Arduino平台开发,先来MicroPython走一波。因为BPI-Pico-RP2040板完全兼容Raspberry Pi Pico,MicroPython的固件直接拿来用,直接在MicroPython - Python for microcontrollers下载固件,将其烧录到BPI-Pico-RP2040开发板即可。
(二)Thonny IDE使用
打开Thonny IDE,在“选项”中选择好解析器和连接端口,如下图:

一切OK的话,Thonny IDE会显示板子上的MicroPython版本信息。

三、规定动作--亮灯
直接来一个经典的闪烁LED功能,程序如下:
from machine import Pin
import time
led = Pin(25, Pin.OUT)
while True:
led.value(1)
time.sleep_ms(500)
led.value(0)
time.sleep_ms(500)
点击Thonny的运行按钮选择板子上运行,shell会提示:
>>> %Run -c $EDITOR_CONTENT
可以看到BPI-Pico-RP2040板的LED已经闪烁起来。

RP
|