Skip to content

PIO constructor type mismatch #5

@utdrmac

Description

@utdrmac

Per suggestions in #4, I'm trying to use the PIO version with my PicoW:

# HX711 Setup
gpio_data = digitalio.DigitalInOut(board.GP18)
gpio_clk = digitalio.DigitalInOut(board.GP19)

hx = HX711_PIO(gpio_data, gpio_clk, tare=False, offset=-155118, scalar=8949.0)

Error when running:

Traceback (most recent call last):
  File "<stdin>", line 50, in <module>
  File "hx711/hx711_pio.py", line 87, in __init__
  File "hx711/hx711_pio.py", line 102, in sm_init
TypeError: first_in_pin must be of type Pin, not DigitalInOut

The constructor for HX711_PIO wants a DigitalInOut but rp2pio.StateMachine wants a Pin (https://docs.circuitpython.org/en/latest/shared-bindings/rp2pio/index.html)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions