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