Skip to content

Make AnalogIn.value return always 16 bit? #97

@caternuson

Description

@caternuson

The CP standard for AnalogIn.value is 16 bit:
https://docs.circuitpython.org/en/latest/shared-bindings/analogio/index.html#analogio.AnalogIn.value

This library wants to follow same convention:

"""The current analog value on the pin, as an integer from 0..65535 (inclusive)"""

NeoSlider (others?) return 10 bit:

Adafruit CircuitPython 7.1.1 on 2022-01-14; Adafruit ItsyBitsy M4 Express with samd51g19
>>> import board
>>> from adafruit_seesaw.seesaw import Seesaw
>>> from adafruit_seesaw.analoginput import AnalogInput
>>> neoslider = Seesaw(board.I2C(), 0x30)
>>> potentiometer = AnalogInput(neoslider, 18)
>>> potentiometer.value
1023
>>> potentiometer.value
943
>>> potentiometer.value
451
>>> potentiometer.value
0
>>> 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions