49 DualLED(
const unsigned int firstColorPinNumber,
const unsigned int secondColorPinNumber);
74 virtual void TurnOn()
override;
86 virtual void TurnOff()
override;
112 virtual std::string
ToString()
const override;
203 void TurnColor(
const unsigned char firstColorVal,
const unsigned char secondColorVal);
245 void FadeToColor(
const unsigned char startFirstColorVal,
const unsigned char startSecondColorVal,
const unsigned char endFirstColorVal,
const unsigned char endSecondColorVal);
Abstract base class for every component (sensor, actuator, etc.) the library manages.
Definition: BaseComponent.h:60
A bi-color LED driven by two PWM pins (one per color).
Definition: DualLED.h:17
unsigned int GetSecondColorPinNumber() const
Gets the PWM pin for the second color.
Definition: DualLED.cpp:406
void RunColorTest()
Runs a short demo that cycles through the LED's on/off and fade behaviours, pausing between each step...
Definition: DualLED.cpp:357
virtual void TurnOff() override
Turns the LED off: drives both colors to zero and stops soft PWM so the LED is actually off.
Definition: DualLED.cpp:160
void TurnFirstColor(const unsigned char firstColorVal)
Sets the first color's PWM level.
Definition: DualLED.cpp:217
void FadeFromFirstToSecondColor()
Fades from the first color fully on to the second color fully on.
Definition: DualLED.cpp:268
unsigned int myFirstColorPinNumber
The PWM pin for the first color.
Definition: DualLED.h:26
void FadeToColor(const unsigned char startFirstColorVal, const unsigned char startSecondColorVal, const unsigned char endFirstColorVal, const unsigned char endSecondColorVal)
Smoothly fades both channels from their start levels to their end levels, one PWM step at a time.
Definition: DualLED.cpp:304
virtual std::string ToString() const override
Serializes the LED's two pin numbers to a string.
Definition: DualLED.cpp:110
void FadeFromSecondColorToFirstColor()
Fades from the second color fully on to the first color fully on.
Definition: DualLED.cpp:283
void TurnColor(const unsigned char firstColorVal, const unsigned char secondColorVal)
Sets both colors' PWM levels at once (a blended color).
Definition: DualLED.cpp:252
void TurnOffFirstColor()
Drives the first color off.
Definition: DualLED.cpp:185
void TurnOnSecondColor()
Drives the second color fully on.
Definition: DualLED.cpp:145
virtual void ProcessRawValues() override
Processes the LED's raw values.
Definition: DualLED.cpp:94
void TurnOnFirstColor()
Drives the first color fully on.
Definition: DualLED.cpp:130
bool myIsOn
True while the PWM pins are created/on, so TurnOn/TurnOff are idempotent (a repeat call is a no-op).
Definition: DualLED.h:32
void TurnOffSecondColor()
Drives the second color off.
Definition: DualLED.cpp:200
unsigned int GetFirstColorPinNumber() const
Gets the PWM pin for the first color.
Definition: DualLED.cpp:389
virtual void TurnOn() override
Turns the LED on: (re)initializes PWM on both pins and drives both colors to full.
Definition: DualLED.cpp:60
DualLED(const unsigned int firstColorPinNumber, const unsigned int secondColorPinNumber)
Builds a dual-color LED on the two given PWM pins.
Definition: DualLED.cpp:20
unsigned int mySecondColorPinNumber
The PWM pin for the second color.
Definition: DualLED.h:29
virtual ~DualLED()
Destroys the LED, stopping soft PWM on both pins.
Definition: DualLED.cpp:44
void TurnSecondColor(const unsigned char secondColorVal)
Sets the second color's PWM level.
Definition: DualLED.cpp:234
RumPi is the library's top-level facade.
Definition: AlertManager.h:6