-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
As currently written, it appears you can only do about 93 SPS. It looks like if there is a shorter delay introduced on analog_read, it drastically increases the sampling rate and it seems to be running stable.
`
def analog_read(self, pin):
"""Read the value of an analog pin by number"""
buf = bytearray(2)
if pin not in self.pin_mapping.analog_pins:
raise ValueError("Invalid ADC pin")
self.read(
_ADC_BASE,
_ADC_CHANNEL_OFFSET + self.pin_mapping.analog_pins.index(pin),
buf,
.0001,
)
ret = struct.unpack(">H", buf)[0]
time.sleep(0.001)
return ret
`
Metadata
Metadata
Assignees
Labels
No labels