Struct blinkt::Blinkt [] [src]

pub struct Blinkt {
    // some fields omitted
}

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

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

Methods

impl Blinkt
[src]

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

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

Creates a new Blinkt using custom settings for the data pin, clock pin, and number of pixels.

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.

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.

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.

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.

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.

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

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

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.

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.

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

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

Trait Implementations

impl Drop for Blinkt
[src]

A method called when the value goes out of scope. Read more