github.com/ev3go/ev3dev depends on ev3dev stretch.
package main
import (
"log"
"time"
"github.com/ev3go/brickpi"
)
func main() {
var bright byte
var err error
for i := 0; i < 10; i++ {
err = brickpi.Blue1.SetBrightness(int(bright)).Err()
if err != nil {
log.Fatal(err)
}
time.Sleep(time.Second)
bright = ^bright
err = brickpi.Blue2.SetBrightness(int(bright)).Err()
if err != nil {
log.Fatal(err)
}
time.Sleep(time.Second)
}
}