Metro ESP32-P4 analogin overflows
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 68/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- c
- 領域
- embedded-iot
研究方向
從ports/espressif/common-hal/analogio/AnalogIn.c開始,特別檢查 issue 中連結的電壓縮放運算式。在判斷提議的縮放與限制是否符合AnalogIn.value的預期範圍之前,先檢查 ESP32-P4 的類比輸入範圍以及現有的類比輸入測試。完成標準是:整個輸入範圍內的讀值不再回繞,相關測試或開發板檢查通過。
由索引模型根據 Issue 內容生成。
描述
CircuitPython version and board name
Adafruit CircuitPython 11.0.0-alpha.2-22-gbe6f0a678b on 2026-10-27; Adafruit Metro ESP32-P4 with ESP32P4
Code/REPL
import time
import board
import analogio
analog_pin = analogio.AnalogIn(board.A0)
while True:
print(analog_pin.value)
time.sleep(0.1)
Behavior
ran with a pot attached to A0, 3.3V power. when the pot gets to about 80% the value reading wraps back around to 100 and reads between 500-700 at max rotation. at minimum rotation it does read 0 as expected. tested with a few different pots.
Description
i was wondering if
return voltage * ((1 << 16) - 1) / 3300;
in common-hal AnalogIn.c could be updated to
uint32_t value = (uint32_t)voltage * 65535 / 3300;
if (value > 65535) {
value = 65535;
}
return (uint16_t)value;
as a fix
Additional information
No response
- 主要語言
- C
- 星號
- 4.6k
- 分支
- 1.4k
- 平均合併
- 1 天 17 小時
- 30 天內合併 PR
- 163
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
adafruit/circuitpython 的其他 Issue
-
documentation enhancement
難度 2/5 1-3 小時 新手友好度 67/100
adafruit/circuitpython#11689 ·
維護者通常 1 天內回覆
-
Feather RP2350: MAX3421E instead of PIO USB host, or a second build?可能已有人在做 @mikeysklar 於 2 天前認領。 未關閉
adafruit/circuitpython#11697 · 1 則留言 · 已指派 2 人 ·
維護者通常 1 天內回覆
-
rp2040 zephyr
難度 5/5 一週以上 新手友好度 35/100
adafruit/circuitpython#11690 ·
維護者通常 1 天內回覆
-
bug esp32-p4 network
難度 4/5 1-2 天 新手友好度 45/100
adafruit/circuitpython#11682 ·
維護者通常 1 天內回覆
-
alarms and sleep bug esp32-c3
難度 4/5 3-5 天 新手友好度 52/100
adafruit/circuitpython#11680 ·
維護者通常 1 天內回覆
查看 adafruit/circuitpython 的全部 Issue