gobot.io/x/gobot/v2@v2.1.0/examples/hello.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  	"fmt"
    11  	"time"
    12  
    13  	"gobot.io/x/gobot/v2"
    14  )
    15  
    16  func main() {
    17  	robot := gobot.NewRobot(
    18  		func() {
    19  			gobot.Every(500*time.Millisecond, func() { fmt.Println("Greetings human") })
    20  		},
    21  	)
    22  
    23  	robot.Start()
    24  }