panel

package
v0.0.0-...-4e6f796 Latest Latest
Warning

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

Go to latest
Published: May 23, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Panel

type Panel struct {
	Address []byte // nil implies broadcast, okay if just one panel

	Width  int
	Height int

	State [][]bool

	Port *serial.Port
}

Panel represents a single flipdot panel

func NewPanel

func NewPanel(w, h int, portName string, portBaud int) *Panel

NewPanel returns a new Panel with the given size, attached to the given port. The panel's Close() should be called when done.

func (*Panel) Clear

func (p *Panel) Clear(state bool)

Clear the dots on or off

func (*Panel) Close

func (p *Panel) Close()

Close the serial port

func (*Panel) Color

func (p *Panel) Color(x, y int) color.RGBA

Color of the given dot- currently assumes black and white

func (*Panel) Get

func (p *Panel) Get(x, y int) bool

Get the state of the dot at the given coordinate as a boolean

func (*Panel) GetInt

func (p *Panel) GetInt(x, y int) int

GetInt returns the state of the dot at the given coordinate as an int

func (*Panel) PrintState

func (p *Panel) PrintState()

func (*Panel) Queue

func (p *Panel) Queue()

Queue the state of the board to the panel, show when Refresh() is called (used for multiple panels)

func (*Panel) Refresh

func (p *Panel) Refresh()

Refresh causes any queued state to be displayed

func (*Panel) Send

func (p *Panel) Send()

Send the state of the board to the associated flip dot panel and refresh

func (*Panel) Set

func (p *Panel) Set(x, y int, state bool)

Set the given coordinate dot on or off

Jump to

Keyboard shortcuts

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