Package import | "zappem.net/pub/io/i2c" |
---|---|
Documentation | https://pkg.go.dev/zappem.net/pub/io/i2c |
Sources | https://github.com/tinkerator/i2c |
The i2c
package provides a native Go interface to the Linux
i2c/smbus device drivers.
Automated package documentation for this Go package should be
available from .
Cross compiling to make something runable on a Raspberry Pi binary can be done as follows:
$ GOARCH=arm GOOS=linux go build example/s35390.go
This example is for a specific i2c device: a real time clock.
Another example looks at the two supported addresses for one of the Bosch pressure sensors:
$ GOARCH=arm GOOS=linux go build example/bpmx8x.go
Explore some different i2c Raspberry Pi hats, perhaps add some more examples.
The i2c
package is distributed with the same BSD 3-clause license as
that used by golang itself.
The package i2c
has been developed purely out of self-interest and a
curiosity for physical IO projects, primarily on the Raspberry
Pi. Should you find a bug or want to suggest a feature addition,
please use the bug
tracker.