mirror of
https://github.com/kidoman/embd
synced 2025-07-03 11:57:38 +02:00
bring in the idea of a hardware abstraction layer
This commit is contained in:
parent
b4de382833
commit
b5e2d0acc7
35 changed files with 994 additions and 971 deletions
|
@ -5,12 +5,17 @@ import (
|
|||
"os"
|
||||
"os/signal"
|
||||
|
||||
"github.com/kidoman/embd/i2c"
|
||||
"github.com/kidoman/embd"
|
||||
"github.com/kidoman/embd/sensor/tmp006"
|
||||
)
|
||||
|
||||
func main() {
|
||||
bus := i2c.NewBus(1)
|
||||
i2c, err := embd.NewI2C()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
bus := i2c.Bus(1)
|
||||
|
||||
sensor := tmp006.New(bus, 0x40)
|
||||
if status, err := sensor.Present(); err != nil || !status {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue