evb

package module
v0.0.0-...-3f929e0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2023 License: BSD-3-Clause Imports: 2 Imported by: 0

README

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

Documentation

Overview

Package evb provides evb-specific and higher level access to the ev3dev control and sensor drivers.

Index

Constants

View Source
const (
	// LCDWidth is the width of the LCD screen in pixels.
	LCDWidth = 220

	// LCDHeight is the height of the LCD screen in pixels.
	LCDHeight = 176

	// LCDStride is the width of the LCD screen memory in bytes.
	LCDStride = 440
)

Variables

LCD is the draw image used draw directly to the evb LCD screen. Drawing operations are safe for concurrent use. It must be initialized before use.

View Source
var Speaker = ev3dev.NewSpeaker("/dev/input/by-path/platform-evb-sound-event")

Speaker is a handle to the evb speaker. It must be initialized before use.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
examples
gopherbrick
gopherbrick demonstrates use of the evb screen.
gopherbrick demonstrates use of the evb screen.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL