Skip to content

Binho Nova adapter instructions #24

Description

@rxbynerd

Not submitting this as a PR to the documentation as I'm not confident in it at all, but wanted to capture this atrocity I've just cooked up, to read a BME280 via the Binho Nova host adapter's Python library:

class BinhoSmbusShim:
    def __init__(self, host_adapter):
        self.binho = host_adapter
    def read_i2c_block_data(self, i2c_address, register, length):
        return self.binho.i2c.transfer(i2c_address, [register], length)

    def write_i2c_block_data(self, i2c_address, register, values):
        self.binho.i2c.transfer(i2c_address, [register] + values, 0)

Usage instructions:

    binho = binhoHostAdapter()
    binho.operationMode = "I2C"

    bme280 = BME280(i2c_dev=BinhoSmbusShim(binho))
    bme280.setup()
    # you can now follow examples/

Fairly confident this glosses over a lot of details (like register width?), but this was enough to get temperature/humidity/pressure out of the sensor so I can carry on with software.

I'm also aware you're no longer stocking Binho Nova, so no worries if you don't want to add in support/documentation for use — this note is just to capture this info in the public domain for next time I need it 🙈

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions