rgbmatrix

package
v0.0.0-...-860d388 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package rgbmatrix talks to the IS31FL3731 i2c LED driver used by the Pimoroni 5x5 RGB Matrix. Code basically ported from Pimoroni's original: https://github.com/pimoroni/rgbmatrix5x5-python

Index

Constants

This section is empty.

Variables

View Source
var Clear = [25]Rgb{
	{0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00},
	{0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00},
	{0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00},
	{0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00},
	{0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00},
}
View Source
var Ghost = [25]Rgb{
	{0x00, 0x00, 0x00}, {0xff, 0x66, 0x00}, {0xff, 0x66, 0x00}, {0xff, 0x66, 0x00}, {0x00, 0x00, 0x00},
	{0xdf, 0x20, 0x00}, {0xdf, 0x20, 0x00}, {0xdf, 0x20, 0x00}, {0xdf, 0x20, 0x00}, {0xdf, 0x20, 0x00},
	{0xaf, 0x10, 0x00}, {0x00, 0x00, 0x00}, {0xaf, 0x10, 0x00}, {0x00, 0x00, 0x00}, {0xaf, 0x10, 0x00},
	{0x90, 0x00, 0x00}, {0x90, 0x00, 0x00}, {0x90, 0x00, 0x00}, {0x90, 0x00, 0x00}, {0x90, 0x00, 0x00},
	{0x80, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x80, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x80, 0x00, 0x00},
}
View Source
var HorizontalBars = [25]Rgb{
	{0xff, 0x00, 0x00}, {0xff, 0x00, 0x00}, {0xff, 0x00, 0x00}, {0xff, 0x00, 0x00}, {0xff, 0x00, 0x00},
	{0x00, 0xff, 0x00}, {0x00, 0xff, 0x00}, {0x00, 0xff, 0x00}, {0x00, 0xff, 0x00}, {0x00, 0xff, 0x00},
	{0xff, 0xff, 0x00}, {0xff, 0xff, 0x00}, {0xff, 0xff, 0x00}, {0xff, 0xff, 0x00}, {0xff, 0xff, 0x00},
	{0x00, 0xff, 0xff}, {0x00, 0xff, 0xff}, {0x00, 0xff, 0xff}, {0x00, 0xff, 0xff}, {0x00, 0xff, 0xff},
	{0x00, 0x00, 0xff}, {0x00, 0x00, 0xff}, {0x00, 0x00, 0xff}, {0x00, 0x00, 0xff}, {0x00, 0x00, 0xff},
}
View Source
var VerticalBars = [25]Rgb{
	{0xff, 0x00, 0x00}, {0x00, 0xff, 0x00}, {0xff, 0xff, 0x00}, {0x00, 0xff, 0xff}, {0x00, 0x00, 0xff},
	{0xff, 0x00, 0x00}, {0x00, 0xff, 0x00}, {0xff, 0xff, 0x00}, {0x00, 0xff, 0xff}, {0x00, 0x00, 0xff},
	{0xff, 0x00, 0x00}, {0x00, 0xff, 0x00}, {0xff, 0xff, 0x00}, {0x00, 0xff, 0xff}, {0x00, 0x00, 0xff},
	{0xff, 0x00, 0x00}, {0x00, 0xff, 0x00}, {0xff, 0xff, 0x00}, {0x00, 0xff, 0xff}, {0x00, 0x00, 0xff},
	{0xff, 0x00, 0x00}, {0x00, 0xff, 0x00}, {0xff, 0xff, 0x00}, {0x00, 0xff, 0xff}, {0x00, 0x00, 0xff},
}

Functions

func Close

func Close()

func Open

func Open(pi *raspi.Adaptor) (err error)

Setup connects to the RgbMatrix device and resets

func Render

func Render() (err error)

func Set

func Set(image [25]Rgb)

Types

type Rgb

type Rgb struct {
	R, G, B uint8
}

func Binary

func Binary(n uint16) [25]Rgb

Binary creates a binary image of a uint16 TODO: Shift from green to red to purple as we get closer to 500

func Fill

func Fill(r Rgb, variance int) [25]Rgb

Fill creates an image fill based on the color r with random variation

Jump to

Keyboard shortcuts

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