mirror of
https://github.com/kidoman/embd
synced 2025-02-08 11:43:18 +01:00
samples: fix to reflect changes in i2c library
This commit is contained in:
parent
cd54380887
commit
c61631dc1a
@ -9,10 +9,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
bus, err := i2c.NewBus(1)
|
bus := i2c.NewBus(1)
|
||||||
if err != nil {
|
|
||||||
log.Panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
sensor := bh1750fvi.New(bh1750fvi.High, bus)
|
sensor := bh1750fvi.New(bh1750fvi.High, bus)
|
||||||
defer sensor.Close()
|
defer sensor.Close()
|
||||||
|
@ -9,10 +9,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
bus, err := i2c.NewBus(1)
|
bus := i2c.NewBus(1)
|
||||||
if err != nil {
|
|
||||||
log.Panic(err)
|
|
||||||
}
|
|
||||||
baro := bmp085.New(bus)
|
baro := bmp085.New(bus)
|
||||||
defer baro.Close()
|
defer baro.Close()
|
||||||
|
|
||||||
|
@ -9,10 +9,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
bus, err := i2c.NewBus(1)
|
bus := i2c.NewBus(1)
|
||||||
if err != nil {
|
|
||||||
log.Panic(err)
|
|
||||||
}
|
|
||||||
baro := bmp180.New(bus)
|
baro := bmp180.New(bus)
|
||||||
defer baro.Close()
|
defer baro.Close()
|
||||||
|
|
||||||
|
@ -11,10 +11,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
bus, err := i2c.NewBus(1)
|
bus := i2c.NewBus(1)
|
||||||
if err != nil {
|
|
||||||
log.Panic(err)
|
|
||||||
}
|
|
||||||
gyro := l3gd20.New(bus, l3gd20.R250DPS)
|
gyro := l3gd20.New(bus, l3gd20.R250DPS)
|
||||||
gyro.Debug = true
|
gyro.Debug = true
|
||||||
defer gyro.Close()
|
defer gyro.Close()
|
||||||
|
@ -9,10 +9,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
bus, err := i2c.NewBus(1)
|
bus := i2c.NewBus(1)
|
||||||
if err != nil {
|
|
||||||
log.Panic(err)
|
|
||||||
}
|
|
||||||
mems := lsm303.New(bus)
|
mems := lsm303.New(bus)
|
||||||
defer mems.Close()
|
defer mems.Close()
|
||||||
|
|
||||||
|
@ -11,10 +11,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
bus, err := i2c.NewBus(1)
|
bus := i2c.NewBus(1)
|
||||||
if err != nil {
|
|
||||||
log.Panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
dac := mcp4725.New(bus, 0x62)
|
dac := mcp4725.New(bus, 0x62)
|
||||||
defer dac.Close()
|
defer dac.Close()
|
||||||
|
@ -11,10 +11,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
bus, err := i2c.NewBus(1)
|
bus := i2c.NewBus(1)
|
||||||
if err != nil {
|
|
||||||
log.Panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
pca9685 := pca9685.New(bus, 0x41, 1000)
|
pca9685 := pca9685.New(bus, 0x41, 1000)
|
||||||
pca9685.Debug = true
|
pca9685.Debug = true
|
||||||
|
@ -12,10 +12,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
bus, err := i2c.NewBus(1)
|
bus := i2c.NewBus(1)
|
||||||
if err != nil {
|
|
||||||
log.Panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
pwm := pca9685.New(bus, 0x41, 50)
|
pwm := pca9685.New(bus, 0x41, 50)
|
||||||
pwm.Debug = true
|
pwm.Debug = true
|
||||||
|
@ -10,10 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
bus, err := i2c.NewBus(1)
|
bus := i2c.NewBus(1)
|
||||||
if err != nil {
|
|
||||||
log.Panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
sensor := tmp006.New(bus, 0x40)
|
sensor := tmp006.New(bus, 0x40)
|
||||||
if status, err := sensor.Present(); err != nil || !status {
|
if status, err := sensor.Present(); err != nil || !status {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user