ledwidget

package
v0.0.0-...-2aedad7 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package ledwidget defines a GIU widget that mimics the appearance of the DE2-115 LED groups.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LedWidget

type LedWidget struct {
	widget.BaseWidget
	// contains filtered or unexported fields
}

LedWidget represents a horizontal strip of up to 32 LEDs, all the same color.

func NewLedWidget

func NewLedWidget(count int, onColor, offColor color.RGBA) *LedWidget

NewLedWidget creates a new LED widget with the given number of LEDs. When an LED is on, it will be displayed with the given onColor, and otherwise as the given offColor.

func (*LedWidget) CreateRenderer

func (l *LedWidget) CreateRenderer() fyne.WidgetRenderer

CreateRenderer implements fyne.Widget

func (*LedWidget) Mask

func (l *LedWidget) Mask() uint32

Mask returns a uint32 with all of the bits corresponding to an LED set to 1.

func (*LedWidget) State

func (l *LedWidget) State() uint32

State returns the current state of the LEDs in this widget.

func (*LedWidget) Update

func (l *LedWidget) Update(newstate uint32)

Update changes the state of the LEDs in this widget, and triggers the graphical widget to refresh.

Jump to

Keyboard shortcuts

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