github.com/ev3go/ev3dev depends on ev3dev stretch. For jessie support see the ev3dev-jessie branch.
package main
import (
"log"
"time"
"github.com/ev3go/ev3"
)
func main() {
var bright byte
var err error
for i := 0; i < 10; i++ {
err = ev3.GreenLeft.SetBrightness(int(bright)).Err()
if err != nil {
log.Fatal(err)
}
time.Sleep(time.Second)
bright = ^bright
err = ev3.GreenRight.SetBrightness(int(bright)).Err()
if err != nil {
log.Fatal(err)
}
time.Sleep(time.Second)
}
}
LEGO® is a trademark of the LEGO Group of companies which does not sponsor, authorize or endorse this software.