gobot.io/x/gobot@v1.16.0/examples/hello.go (about)

     1  // +build example
     2  //
     3  // Do not build by default.
     4  
     5  package main
     6  
     7  import (
     8  	"fmt"
     9  	"time"
    10  
    11  	"gobot.io/x/gobot"
    12  )
    13  
    14  func main() {
    15  	robot := gobot.NewRobot(
    16  		func() {
    17  			gobot.Every(500*time.Millisecond, func() { fmt.Println("Greetings human") })
    18  		},
    19  	)
    20  
    21  	robot.Start()
    22  }