flapper

package module
v0.0.0-...-006602b Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2023 License: MIT Imports: 21 Imported by: 0

README

flapper

A control program for splitflap displays.

Some time ago I became fascinated by some projects that were recreating the old splitflap displays that used to be common in train stations and clock radios. The initial spark came from this project, which is funny and probably cathartic, but the thing that stuck with me was the sound it made, so familiar and yet forgotten. If you were ever in Grand Central when the old departure boards built out of these things were still there, you'll remember the sound they made and the way each letter would appear out of the chaos of flipping characters.

The Profan-O-Matic used a splitflap module design created by Scott Bezek, and it's an impressive piece of work. If you're interested in building your own I recommend it, it's quite fun. I did, and eventually I ended up with 24 splitflap modules in a wooden case.

The latest versions of the project use the gRPC protocol for communication with the display.

Documentation

Overview

Package flapper implements an interface for controlling a set of splitflap displays, built using the design at github.com/scottbez1/splitflap. Commands are sent over a tty connection to the controller board, using the new protobuf interface to the controller.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Display

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

Display represents one or more splitflap units connected to a controller.

func NewDisplay

func NewDisplay() (*Display, error)

NewDisplay returns a new Display struct, representing a splitflap display with one or more modules.

func (*Display) Close

func (d *Display) Close()

Close will close the serial port and stop the comms goroutine.

func (*Display) HardReset

func (d *Display) HardReset()

HardReset will reset the whole microcontroller.

func (*Display) Init

func (d *Display) Init() error

Init requests the display state, and should be called after connecting.

func (*Display) PrepText

func (d *Display) PrepText(text string) string

func (*Display) SetAnimStyle

func (d *Display) SetAnimStyle(animStyle string) error

SetAnimStyle sets the animation style using the enum defined in the protobuf.

func (*Display) SetForceRotation

func (d *Display) SetForceRotation(on bool) error

SetForceRotation turns the force_full_rotation setting on or off. If this setting is on, the display will go through a full rotation when the character for a cell is set to its current value.

func (*Display) SetMaxMoving

func (d *Display) SetMaxMoving(max uint32) error

SetMaxMoving sets the maximum number of cells that are allowed to be moving at one time.

func (*Display) SetStartDelay

func (d *Display) SetStartDelay(delay uint32) error

SetStartDelay sets the delay between starting one module and the next, in milliseconds.

func (*Display) SetText

func (d *Display) SetText(text string) error

SetText will display the passed string on the splitflaps. If the string is shorter than the available cells on the display it will be padded with spaces; if it's longer it will be truncated mercilessly. TODO: validate each character - don't pass runes the display can't display.

func (*Display) Settings

func (d *Display) Settings() *proto.Settings

Settings returns the current display settings.

func (*Display) Status

func (d *Display) Status() *proto.SplitflapState

Status returns the current state of the display: how big it is, what it's showing, and error stats for each cell.

func (*Display) Text

func (d *Display) Text() string

Text returns what the display is currently showing.

Directories

Path Synopsis
cmd
flapperd
Package main implements flapperd, the splitflap display daemon.
Package main implements flapperd, the splitflap display daemon.

Jump to

Keyboard shortcuts

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