Module led::rgb

source ·
Expand description

RGB LEDs

Various types of RGB LEDs.

Examples

use led::LED;
use led::rgb::{Color, CommonAnodeLED};

let mut led = CommonAnodeLED::new(r, g, b);

led.set(Color::Green);
use led::LED;
use led::rgb::{Color, CommonAnodeLED, CommonCathodeLED, RGB};

let mut leds: [&mut RGB; 2] = [
    &mut CommonAnodeLED::new(r1, g1, b1),
    &mut CommonCathodeLED::new(r2, g2, b2),
];

for led in leds.iter_mut() {
    led.set(Color::Red)
}

Structs

  • A marker type that represents a common anode connection.
  • A marker type that represents a common cathode connection.
  • An RGB LED

Enums

  • The set of primary colors and secondary colors that can be created by an RGB LED along with black and white.

Traits

  • The polarity of the LED; either anode or cathode.
  • An RGB LED; either common anode or common cathode.

Type Definitions