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 ¶
- type Display
- func (d *Display) Close()
- func (d *Display) HardReset()
- func (d *Display) Init() error
- func (d *Display) PrepText(text string) string
- func (d *Display) SetAnimStyle(animStyle string) error
- func (d *Display) SetForceRotation(on bool) error
- func (d *Display) SetMaxMoving(max uint32) error
- func (d *Display) SetStartDelay(delay uint32) error
- func (d *Display) SetText(text string) error
- func (d *Display) Settings() *proto.Settings
- func (d *Display) Status() *proto.SplitflapState
- func (d *Display) Text() string
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 ¶
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) SetAnimStyle ¶
SetAnimStyle sets the animation style using the enum defined in the protobuf.
func (*Display) SetForceRotation ¶
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 ¶
SetMaxMoving sets the maximum number of cells that are allowed to be moving at one time.
func (*Display) SetStartDelay ¶
SetStartDelay sets the delay between starting one module and the next, in milliseconds.
func (*Display) SetText ¶
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) 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.