Skip to content

Latest commit

 

History

History
49 lines (38 loc) · 1.08 KB

README.md

File metadata and controls

49 lines (38 loc) · 1.08 KB

Gopherbrick

evb provides EVB-specific functions for the Go ev3dev interface

Build Status Coverage Status GoDoc

github.com/ev3go/evb depends on an ev3dev kernel 4.4.9-ti-rt-r25-11-ev3dev-bb.org or better.

Example code

package main

import (
	"image"
	"image/draw"
	"time"

	"github.com/ev3go/ev3dev/fb"
	"github.com/ev3go/evb"
)

func main() {
	evb.LCD.Init(true)
	defer evb.LCD.Close()

	// Render the gopherbrick to the screen.
	draw.Draw(evb.LCD, evb.LCD.Bounds(), gopher, gopher.Bounds().Min, draw.Src)

	time.Sleep(10 * time.Second)
}

var gopher = &fb.RGB565{
	Pix: []uint8{
		<snip image data bytes>
	},
	Stride: 440,
	Rect: image.Rectangle{
		Min: image.Point{
			X: 0,
			Y: 0,
		},
		Max: image.Point{
			X: 220,
			Y: 176,
		},
	},
}