Skip to content

lis3dh_simpletest does not work for pygamer #52

Closed
@jerryneedell

Description

@jerryneedell

The current lis3dh_simpletest example uses the existence of ACCELEROMETER_SCL to determine the pin configuration and I2C address
https://github.com/adafruit/Adafruit_CircuitPython_LIS3DH/blob/master/examples/lis3dh_simpletest.py#L9

if hasattr(board, 'ACCELEROMETER_SCL'):
    i2c = busio.I2C(board.ACCELEROMETER_SCL, board.ACCELEROMETER_SDA)
    int1 = digitalio.DigitalInOut(board.ACCELEROMETER_INTERRUPT)
    lis3dh = adafruit_lis3dh.LIS3DH_I2C(i2c, address=0x19, int1=int1)
else:
    i2c = busio.I2C(board.SCL, board.SDA)
    int1 = digitalio.DigitalInOut(board.D6)  # Set to correct pin for interrupt!
    lis3dh = adafruit_lis3dh.LIS3DH_I2C(i2c, int1=int1)

But this does not work for the pygamer. It has ACCELEROMETER_INTERRUPT but uses the default board SCL/SDA.

I'll be happy to put in a PR but wanted to see how you wanted to implement it or should there just be a separate lis3dh_pygamer_simpletest?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions