iio-sensor-proxy bindings for Go, based on godbus
This is my first Go project. It might not follow best practices, etc. If so, please do let me know ;)
$ go get github.com/Depau/go-iio-sensor-proxy
Get a connection to the system bus:
conn, err := dbus.SystemBus()
if err != nil {
log.Fatal(err)
}
Get an instance of the sensor proxy:
sensorProxy, err := sensorproxy.NewSensorProxyFromBus(conn)
if err != nil {
log.Fatal(err)
}
Then use it:
err := sensorProxy.ClaimAccelerometer()
// [handle error]
orientation, err := sensorProxy.GetAccelerometerOrientation()
// ...