Struct blinkt::Blinkt [] [src]

pub struct Blinkt { /* fields omitted */ }

Interface for a Blinkt! or any similar APA102 or SK9822 strips/boards.

By default, Blinkt is set up to communicate with an 8-pixel board through data pin GPIO 23 and clock pin GPIO 24. These settings can be changed to support alternate configurations.

Methods

impl Blinkt
[src]

[src]

Creates a new Blinkt using the default settings for a Pimoroni Blinkt! board.

This sets the data pin to GPIO 23, the clock pin to GPIO 24, and number of pixels to 8.

[src]

Creates a new Blinkt using custom settings for the data pin, clock pin, and number of pixels. Pins should be specified by their BCM GPIO pin numbers.

[src]

When enabled, clears all pixels when the Blinkt goes out of scope.

Drop methods aren't called when a program is abnormally terminated, for instance when a user presses Ctrl-C, and the SIGINT signal isn't caught. You'll either have to catch those using crates such as simple_signal, or manually call cleanup().

Enabled by default.

[src]

Changes the GPIO pin mode for the data and clock pins back to their original state, and optionally clears all pixels.

Normally, this method is automatically called when Blinkt goes out of scope, but you can manually call it to handle early/abnormal termination. After calling this method, any future calls to show() won't have any result.

[src]

Sets the red, green and blue values for a single pixel in the local buffer.

For an 8-pixel board, valid values for pixel are 0-7. Valid values for red, green and blue are 0-255.

[src]

Sets the red, green, blue and brightness values for a single pixel in the local buffer.

For an 8-pixel board, valid values for pixel are 0-7. Valid values for red, green and blue are 0-255. Valid values for brightness are 0.0-1.0, which is converted to a 5-bit value.

[src]

Sets the brightness value for a single pixel in the local buffer.

For an 8-pixel board, valid values for pixel are 0-7. Valid values for brightness are 0.0-1.0, which is converted to a 5-bit value.

[src]

Sets the red, green and blue values for all pixels in the local buffer.

Valid values for red, green and blue are 0-255.

[src]

Sets the red, green, blue and brightness values for all pixels in the local buffer.

Valid values for red, green and blue are 0-255. Valid values for brightness are 0.0-1.0, which is converted to a 5-bit value.

[src]

Sets the brightness value for all pixels in the local buffer.

Valid values for brightness are 0.0-1.0, which is converted to a 5-bit value.

[src]

Sets the red, green and blue values to 0 for all pixels in the local buffer.

[src]

Sends the contents of the local buffer to the pixels, updating their LED colors and brightness.

Trait Implementations

impl Drop for Blinkt
[src]

[src]

Executes the destructor for this type. Read more