-
-
Notifications
You must be signed in to change notification settings - Fork 1k
/
Copy pathdoc.go
52 lines (39 loc) · 1.09 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//go:build libusb
// +build libusb
/*
Package digispark provides the Gobot adaptor for the Digispark ATTiny-based USB development board.
Installing:
This package requires installing `libusb`.
Then you can install the package with:
Please refer to the main [README.md](https://github.com/hybridgroup/gobot/blob/release/README.md)
Example:
package main
import (
"time"
"gobot.io/x/gobot/v2"
"gobot.io/x/gobot/v2/drivers/gpio"
"gobot.io/x/gobot/v2/platforms/digispark"
)
func main() {
digisparkAdaptor := digispark.NewAdaptor()
led := gpio.NewLedDriver(digisparkAdaptor, "0")
work := func() {
gobot.Every(1*time.Second, func() {
if err := led.Toggle(); err != nil {
fmt.Println(err)
}
})
}
robot := gobot.NewRobot("blinkBot",
[]gobot.Connection{digisparkAdaptor},
[]gobot.Device{led},
work,
)
if err := robot.Start(); err != nil {
panic(err)
}
}
For further information refer to digispark README:
https://github.com/hybridgroup/gobot/blob/release/platforms/digispark/README.md
*/
package digispark // import "gobot.io/x/gobot/v2/platforms/digispark"