1
0
mirror of https://github.com/kidoman/embd synced 2024-12-22 12:50:19 +01:00

better examples in doc

This commit is contained in:
Karan Misra 2013-12-09 03:21:05 +05:30
parent b42cec847f
commit f51069beb0

6
doc.go
View File

@ -3,6 +3,8 @@ Package rpi provides modules which will help gophers deal with various sensors.
Use the default i2c bus to read/write data: Use the default i2c bus to read/write data:
import "github.com/kid0m4n/go-rpi/i2c"
...
value, err := i2c.ReadInt(0x1E, 0x03) value, err := i2c.ReadInt(0x1E, 0x03)
... ...
value := make([]byte, 6) value := make([]byte, 6)
@ -12,12 +14,16 @@ Use the default i2c bus to read/write data:
Read data from the BMP085 sensor: Read data from the BMP085 sensor:
import "github.com/kid0m4n/go-rpi/sensor/bmp085"
...
temp, err := bmp085.Temperature() temp, err := bmp085.Temperature()
... ...
altitude, err := bmp085.Altitude() altitude, err := bmp085.Altitude()
Find out the heading from the LSM303 magnetometer: Find out the heading from the LSM303 magnetometer:
import "github.com/kid0m4n/go-rpi/sensor/lsm303"
...
heading, err := lsm303.Heading() heading, err := lsm303.Heading()
*/ */
package rpi package rpi