1
0
Fork 0
mirror of https://github.com/kidoman/embd synced 2025-07-03 03:47:33 +02:00

make the framework easier to begin with

This commit is contained in:
Karan Misra 2014-03-01 20:19:44 +05:30
parent ef87ad7879
commit 3d08995000
26 changed files with 237 additions and 170 deletions

View file

@ -5,17 +5,18 @@ import (
"os"
"os/signal"
"time"
"github.com/kidoman/embd"
"github.com/kidoman/embd/i2c"
"github.com/kidoman/embd/sensor/l3gd20"
)
func main() {
i2c, err := embd.NewI2C()
if err != nil {
if err := i2c.Open(); err != nil {
panic(err)
}
defer i2c.Close()
bus := i2c.Bus(1)
bus := i2c.NewBus(1)
gyro := l3gd20.New(bus, l3gd20.R250DPS)
gyro.Debug = true