microbitmatrix

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2020 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package microbitmatrix implements a driver for the BBC micro:bit's LED matrix.

Schematic: https://github.com/bbcmicrobit/hardware/blob/master/SCH_BBC-Microbit_V1.3B.pdf

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Rotation uint8
}

type Device

type Device struct {
	// contains filtered or unexported fields
}

func New

func New() Device

New returns a new microbitmatrix driver.

func (*Device) ClearDisplay

func (d *Device) ClearDisplay()

ClearDisplay erases the internal buffer

func (*Device) Configure

func (d *Device) Configure(cfg Config)

Configure sets up the device.

func (*Device) DisableAll

func (d *Device) DisableAll()

DisableAll disables all the LEDs without modifying the buffer

func (*Device) Display

func (d *Device) Display() error

Display sends the buffer (if any) to the screen.

func (*Device) EnableAll

func (d *Device) EnableAll()

EnableAll enables all the LEDs without modifying the buffer

func (*Device) GetPixel

func (d *Device) GetPixel(x int16, y int16) bool

GetPixel returns if the specific pixels is enabled

func (*Device) SetPixel

func (d *Device) SetPixel(x int16, y int16, c color.RGBA)

SetPixel modifies the internal buffer in a single pixel.

func (*Device) SetRotation

func (d *Device) SetRotation(rotation uint8)

SetRotation changes the rotation of the LED matrix

func (*Device) Size

func (d *Device) Size() (w, h int16)

Size returns the current size of the display.

Jump to

Keyboard shortcuts

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