-
-
Notifications
You must be signed in to change notification settings - Fork 1k
/
doc.go
46 lines (35 loc) · 992 Bytes
/
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
/*
Package firmata provides the Gobot adaptor for microcontrollers that support the Firmata protocol.
Installing:
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/firmata"
)
func main() {
firmataAdaptor := firmata.NewAdaptor("/dev/ttyACM0")
led := gpio.NewLedDriver(firmataAdaptor, "13")
work := func() {
gobot.Every(1*time.Second, func() {
if err := led.Toggle(); err != nil {
fmt.Println(err)
}
})
}
robot := gobot.NewRobot("bot",
[]gobot.Connection{firmataAdaptor},
[]gobot.Device{led},
work,
)
if err := robot.Start(); err != nil {
panic(err)
}
}
For further information refer to firmata readme:
https://github.com/hybridgroup/gobot/blob/release/platforms/firmata/README.md
*/
package firmata // import "gobot.io/x/gobot/v2/platforms/firmata"