一、产品概述
Adafruit 5691(ESP32‑S3 Reverse TFT Feather) 是美国Adafruit公司推出的Feather规格物联网开发板,集成ESP32‑S3无线模组、1.14英寸反向安装TFT彩屏,专为面板安装与带屏IoT原型设计,支持Arduino/CircuitPython双开发环境。
二、核心参数
- 主控:ESP32‑S3(Xtensa LX7双核,240 MHz),4 MB Flash + 2 MB PSRAM + 512 KB SRAM。
- 无线:Wi‑Fi 802.11 b/g/n(2.4 GHz)、Bluetooth 5.x BLE,模组带FCC/CE认证。
- 显示:1.14英寸IPS TFT,240×135像素,反向安装(背面出线)。
- 接口:STEMMA QT(I²C)、原生USB、GPIO排针,预留3个按键位置。
- 供电:3.3 V,支持USB/电池供电,Feather标准尺寸(51×23 mm)。
三、产品特点
1. 反向屏幕设计:TFT屏装在板背,适配面板嵌入安装,正面可贴面板/外壳。
2. 大容量存储:4 MB Flash+2 MB PSRAM,支持CircuitPython大程序与图像缓存。
3. 即插即用生态:STEMMA QT免焊传感器扩展,Adafruit IO云平台无缝对接。
4. 双编程支持:Arduino IDE与CircuitPython,适合入门到进阶开发。
5. 无线一体化:Wi‑Fi+BLE双模,覆盖IoT数据传输与蓝牙近场通信场景。
四、测评内容
本次测评将使用开发板产生PWM输出脉冲控制直流电机运行,然后通过引脚读取电机自带光电编码器输出脉冲进行测速,首先查询硬件引脚:


电机引脚图如下:
硬件接线如图:
编写程序:
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
# This example uses an L9110 H-bridge driver to run a DC Motor using two PWM pins.
# https://www.adafruit.com/product/4489
# Hardware setup:
# DC motor via L9110 H-bridge driver on two PWM pins that are on their own channels
# e.g., RP2040 Pico pins GP28, GP27
import time
import board
import pwmio
import countio
from adafruit_motor import motor
PWM_PIN_A = board.D13 # pick any pwm pins on their own channels
PWM_PIN_B = board.D12
PULSE_PIN = board.D11
# 初始化计数器
# edge: 计数模式
# countio.Edge.RISE: 仅计数上升沿
# countio.Edge.FALL: 仅计数下降沿
# countio.Edge.RISE_AND_FALL: 计数上升和下降沿(注意:部分ESP32变种可能不支持双边沿,若报错请改用单边沿)
try:
counter = countio.Counter(PULSE_PIN, edge=countio.Edge.RISE)
except ValueError:
# 如果双边沿不支持,尝试仅上升沿
counter = countio.Counter(PULSE_PIN, edge=countio.Edge.RISE)
pwm_a = pwmio.PWMOut(PWM_PIN_A, frequency=10000)
pwm_b = pwmio.PWMOut(PWM_PIN_B, frequency=10000)
motor1 = motor.DCMotor(pwm_a, pwm_b)
print("***DC motor test***")
print("\nForwards slow")
motor1.throttle = 0.5
print(" throttle:", motor1.throttle)
time.sleep(1)
print("\n***Motor test is complete***")
print("开始计数... 请将脉冲信号连接到引脚:", PULSE_PIN)
last_count = 0
last_time = time.monotonic()
while True:
current_count = counter.count
current_time = time.monotonic()
# 每秒打印一次计数值和频率
if current_time - last_time >= 1.0:
pulses_per_second = current_count - last_count
print(f"总脉冲数: {current_count}, 最近1秒频率: {pulses_per_second} Hz")
last_count = current_count
last_time = current_time
# 短暂延时,避免过度占用USB通信带宽,但不影响硬件计数
time.sleep(0.1)
# 注意:在实际应用中,如果需要停止计数或释放引脚,请调用:
# counter.deinit()
在REPL界面可以观察到1秒输入的脉冲个数:
外接逻辑分析仪检测D13引脚脉冲输出:
我要赚赏金
