mirror of
https://github.com/kidoman/embd
synced 2025-07-03 03:47:33 +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
|
@ -6,12 +6,17 @@ import (
|
|||
"os"
|
||||
"os/signal"
|
||||
|
||||
"github.com/kidoman/embd"
|
||||
"github.com/kidoman/embd/controller/mcp4725"
|
||||
"github.com/kidoman/embd/i2c"
|
||||
)
|
||||
|
||||
func main() {
|
||||
bus := i2c.NewBus(1)
|
||||
i2c, err := embd.NewI2C()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
bus := i2c.Bus(1)
|
||||
|
||||
dac := mcp4725.New(bus, 0x62)
|
||||
defer dac.Close()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue