Skip to content

Example in comments in i2c.py doesn't works (for me) #51

Description

@gustavovelascoh

This example provided in comments of i2c.py does not works for me, appears a TypeError message:

"For example:

    from quick2wire.i2c import I2CMaster, writing

    with I2CMaster() as i2c:
        i2c.transaction(
            writing(0x20, bytes([0x01, 0xFF])))"

Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
TypeError: 'tuple' object is not callable

I have to change it to this for it to work:

For example:

    from quick2wire.i2c import I2CMaster, writing

    with I2CMaster() as i2c:
        i2c.transaction(
            writing(0x20, (0x01, 0xFF)))

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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