Class fx_led¶
Defined in File dreammakerfx.h
Class Documentation¶
-
class
fx_led
¶ These functions are used to control the LEDs on the pedal.
The LEDs are part of the
pedal
object. The LEDs available on the first version of hardware arepedal.led_left
andpedal.led_right
. On the second generation of hardware, there is also apedal.led_center
. Add the routines described below to these like so:To turn on the left LED:
pedal.led_left.turn_on(); // Turn on left LED
To turn off the right LED;
pedal.led_right.turn_off(); // Turn off right LED
To set the center LED to a purplish color:
pedal.led_center.turn_on(40, 0, 50); // Red = 40, Blue = 50
Fade the right LED from red to blue over 1 second
pedal.led_right.set_rgb(RED); pedal.led_right.fade_to_rgb(BLUE, 1000.0);
Public Functions
-
void
turn_on
()¶ Turns on this LED. When using an RGB LED, this turns it on to red.
pedal.led_right.turn_on(); // turns on the right LED
-
void
turn_on
(uint8_t red, uint8_t green, uint8_t blue)¶ Turns on this LED to a specific RGB color.
pedal.led_left.turn_on(100, 0, 75); // turn left LED purple
- Parameters
[in] red
: The red component (0-255)[in] green
: The green component (0-255)[in] blue
: The blue component (0-255)
-
void
turn_on
(LED_COLOR rgb)¶ Turns on this LED to a specific RGB color. If the LED is not an RGB LED, it will just turn on the LED anyway.
pedal.led_left.turn_on(GREEN);
- Parameters
[in] rgb
: The color from LED_COLOR type
-
void
turn_off
()¶ Turns off this LED.
pedal.led_center.turn_off(); // turn off center LED
-
void
set_rgb
(uint8_t red, uint8_t green, uint8_t blue)¶ Sets the RGB color value for this LED.
pedal.led_center.set_rgb(40, 0, 50); // Set center LED to purplish color
- Parameters
[in] red
: The new red component (0-255)[in] green
: The new green component (0-255)[in] blue
: The new blue component (0-255)
-
void
set_rgb
(LED_COLOR rgb)¶ Sets the RGB color value for this LED.
pedal.led_right.set_rgb(RED); // set right LED to red color
- Parameters
[in] rgb
: The color from LED_COLOR type
-
void
fade_to_rgb
(uint8_t red, uint8_t green, uint8_t blue, uint32_t milliseconds)¶ Fade this LED to a new RGB value. The fade happens in the background.
Fade the right LED from red to blue over 1 second.
pedal.led_right.set_rgb(RED); pedal.led_right.fade_to_rgb(0, 0, 100, 1000.0);
The fade happens in the background so the code execution will not wait until the fade completes.
- Parameters
[in] red
: The red component (0-255)[in] green
: The green component (0-255)[in] blue
: The blue component (0-255)[in] milliseconds
: The milliseconds component (0-255)
-
void
fade_to_rgb
(LED_COLOR rgb, uint32_t milliseconds)¶ Fade this LED to a new RGB value.
Fade the right LED from red to blue over 1 second
pedal.led_right.set_rgb(RED); pedal.led_right.fade_to_rgb(BLUE, 1000.0);
The fade happens in the background so the code execution will not wait until the fade completes.
- Parameters
[in] rgb
: The color from LED_COLOR type[in] milliseconds
: The milliseconds to perform fade over
-
void
service
()¶
-
void