Documentation ¶
Overview ¶
Package runner orchestrates the overall system behavior. This includes rendering scenes, handling button presses, and writing to the display.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buttons ¶
type Buttons interface {
RegisterHandlers(a, b, c, d, e func())
}
Buttons defines the behavior that the runner expects for the buttons.
type Display ¶
type Display interface { SetBuffer([][]byte) SetBrightness(brightness byte) Show() error Width() int Height() int }
Display defines the behavior that the runner expects for the display object.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner orchestrates the overall system behavior.
func New ¶
func New( config *scenes.Config, scenes map[scenes.Type]scenes.Scene, sceneTypes []scenes.Type, display Display, buttons Buttons, pixel Pixel, saveConfig func(), exit <-chan bool, ) *Runner
New returns a new Runner.
func (*Runner) Run ¶
Run is the main orchestration loop. It has several responsibilities.
First, it kicks off a goroutine to send color data to the LED pixel in a rainbow pattern. It keeps track of total and per-frame timings. It uses these to calculate FPS, as well as trigger the current scene to render. Finally, tt sends the resulting rendered buffer to the display, and pauses if needed to limit the maximum FPS.