mirror of
https://github.com/kidoman/embd
synced 2025-07-03 11:57:38 +02:00
make the framework easier to begin with
This commit is contained in:
parent
ef87ad7879
commit
3d08995000
26 changed files with 237 additions and 170 deletions
|
@ -6,17 +6,17 @@ import (
|
|||
"os/signal"
|
||||
"time"
|
||||
|
||||
"github.com/kidoman/embd"
|
||||
"github.com/kidoman/embd/controller/pca9685"
|
||||
"github.com/kidoman/embd/i2c"
|
||||
)
|
||||
|
||||
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)
|
||||
|
||||
pca9685 := pca9685.New(bus, 0x41)
|
||||
pca9685.Freq = 1000
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue