adafruit / adafruit/Adafruit_CircuitPython_seesaw

Make AnalogIn.value return always 16 bit?

Open
#97 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
68
Forks
37
PR merge metrics
No merged PRs in 30d

Description

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:
https://github.com/adafruit/Adafruit_CircuitPython_seesaw/blob/fd26309627c0758c982d272b6c708322102bddbf/adafruit_seesaw/analoginput.py#L34

[NeoSlider](https://www.adafruit.com/product/5295) (others?) return 10 bit:
```python
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
>>>
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the AnalogInput implementation in analoginput.py and compare its value behavior with the CircuitPython AnalogIn standard and the linked seesaw implementation. The work is done when AnalogIn.value consistently follows the 16-bit convention instead of returning the observed 10-bit range; no test file is mentioned.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
embedded-iot
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.