Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/depau/go-iio-sensor-proxy
IIO Sensor Proxy bindings for Go
https://github.com/depau/go-iio-sensor-proxy
bindings dbus golang iio-sensor-proxy
Last synced: about 2 months ago
JSON representation
IIO Sensor Proxy bindings for Go
- Host: GitHub
- URL: https://github.com/depau/go-iio-sensor-proxy
- Owner: depau
- License: mit
- Created: 2019-04-27T22:44:12.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-04-27T23:15:58.000Z (over 5 years ago)
- Last Synced: 2024-06-20T15:00:24.877Z (7 months ago)
- Topics: bindings, dbus, golang, iio-sensor-proxy
- Language: Go
- Size: 4.88 KB
- Stars: 2
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# iio-sensor-proxy - Go bindings
[iio-sensor-proxy](https://github.com/hadess/iio-sensor-proxy) bindings for Go, based on [godbus](https://github.com/godbus/dbus/)
### Note
This is my first Go project. It might not follow best practices, etc. If so, please **do** let me know ;)
## Usage
```
$ go get github.com/Depau/go-iio-sensor-proxy
```Get a connection to the system bus:
```go
conn, err := dbus.SystemBus()
if err != nil {
log.Fatal(err)
}
```Get an instance of the sensor proxy:
```go
sensorProxy, err := sensorproxy.NewSensorProxyFromBus(conn)
if err != nil {
log.Fatal(err)
}
```Then use it:
```go
err := sensorProxy.ClaimAccelerometer()
// [handle error]
orientation, err := sensorProxy.GetAccelerometerOrientation()
// ...
```