8000 analogbufio.BufferedIn fails on ItsyBitsy esp32 · Issue #9504 · adafruit/circuitpython · GitHub
[go: up one dir, main page]

Skip to content
analogbufio.BufferedIn fails on ItsyBitsy esp32 #9504
Closed
@graeme-winter

Description

@graeme-winter

CircuitPython version

Adafruit CircuitPython 9.1.1 on 2024-07-22; Adafruit ItsyBitsy ESP32 with ESP32

Code/REPL

import board
import analogbufio
import array

N = 1000
rate = 1000

buffer = array.array("H", [0x0000] * N)
adc = analogbufio.BufferedIn(board.A3, sample_rate=rate)
adc.readinto(buffer)
adc.deinit()
for i in range(N):
    print(i, buffer[i])

Behavior

>>> %Run -c $EDITOR_CONTENT
Traceback (most recent call last):
  File "<stdin>", line 10, in <module>
espidf.IDFError: Invalid argument
>>> 

Description

Tested multiple ADC inputs, none seem to work correctly, code taken almost verbatim from documentation

Aware that ADC2 is used for WiFi applications but this is ADC1, error reported unhelpful. ADC itself is working fine e.g.

import board
import analogio
adc = analogio.AnalogIn(board.A3)
print(adc.value)

gives a value proportional to Vin

Additional information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0