A single individually-controllable LED. Pixels are uniquely addressed by the strip they are part of and their index along the strip.
A strip is a linear collection of pixels. Strips are logically contiguous but may not be physically contiguous. For example, a single strip can run back and forth to make a grid, but from the perspective of the system is still a linear sequence of pixels.
Each PixelPusher can drive up to eight strips, and each of the strips has 240 pixels.
The layout maps pixels to a physical location. For example, in the old linear layout, each pixel is placed along an arc across the surface of the dome. The coordinates set by the layout are passed to the active mode, which can choose to use either the canonical strip/index coordinate or the physical pixel location to set the color.
Pixel locations are given in both the familiar cartesian [x y z]
coordinate
vector as well as
spherical coordinates,
with the special case that the radius is generally a fixed size because the
strips are laid against the surface of a geodesic dome. Spherical coordinates
have three components:
- r: the radius of the pixel, in meters.
- theta: the polar angle from straight vertical (the pole) in radians.
- phi: the azimuthal angle around the pole, in radians.
An event is some input that is given to the system to update its state. The
most common event type is a :dt
timer tick, or user input in the form of
button events from the gamepad controller or web interface. Another type of
event could contain frames of audio data.
A mode is a visualization which contains some state and renders pixel colors based on their coordinates. Mode states can be updated over time or in response to input events.
An event handler is a function which takes the current system state and an input
event and returns a new system state in response to the event. The primary
handler is update-mode
, which finds the current mode in the system and updates
its state by calling mode/update
with the event.
This gets more complex when middleware is used. Middleware functions wrap
another event handler with some additional logic; for example, a switch-modes
middleware could catch presses of the select button and rotate the current mode
instead of passing the event down to the mode for updating.
A display contains a number of pixels and provides a target for setting the pixel colors. The two primary displays are a Processing sketch for local development, and the PixelPusher output for rendering to the actual LED hardware.