gobot.io/x/gobot@v1.16.0/examples/firmata_blink_metal.go (about) 1 // +build example 2 // 3 // Do not build by default. 4 5 package main 6 7 import ( 8 "time" 9 10 "gobot.io/x/gobot/drivers/gpio" 11 "gobot.io/x/gobot/platforms/firmata" 12 ) 13 14 // Example of a simple led toggle without the initialization of 15 // the entire gobot framework. 16 // This might be useful if you want to use gobot as another 17 // golang library to interact with sensors and other devices. 18 func main() { 19 f := firmata.NewAdaptor("/dev/ttyACM0") 20 f.Connect() 21 22 led := gpio.NewLedDriver(f, "13") 23 led.Start() 24 25 for { 26 led.Toggle() 27 time.Sleep(1000 * time.Millisecond) 28 } 29 }