Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 975 Bytes

README.md

File metadata and controls

39 lines (30 loc) · 975 Bytes

Gopherbrick

brickpi provides BrickPi-specific functions for the Go ev3dev interface

Build Status Coverage Status GoDoc

github.com/ev3go/ev3dev depends on ev3dev stretch.

Example code

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)
	}
}