adafruit / Adafruit_CircuitPython_seesaw

seesaw helper IC driver for circuitPython
MIT License
64 stars 36 forks source link

file attinyx16.py analog pins only for output? (the text of the definitions tells us) #133

Open PaulskPt opened 9 months ago

PaulskPt commented 9 months ago

I am using an Adafruit Gamepad QT (ID 5743). While diving into this Adafruit_Circuitpython_seesaw module I found that the text in the file attinyx16.py, lines 21-22 read:

    """The pins capable of analog output"""
    analog_pins = (0, 1, 2, 3, 4, 5, 14, 15, 16)

however, this file is also used for the Adafruit Gamepad QT (ID 5743).

The text in Adafruit Learn for the Gamepad QT pinouts says the following:

Joystick
This is the 2-axis joystick located on the left side of the board.

X-axis - The joystick x-axis (horizontal) is on pin 14 in the seesaw firmware.
Y-axis - The joystick y-axis (vertical) is on pin 15 in the seesaw firmware.

In test scripts these Joystick X-Y values are usually read using commands like this:

            x = 1023 - seesaw.analog_read(14)
            y = 1023 - seesaw.analog_read(15)

I suggest to change the text in file attynx16.py, lines 21-22, and have them read (for example) like:

    """The pins capable of analog input and output"""
    analog_pins = (0, 1, 2, 3, 4, 5, 14, 15, 16)