Dezibot 4
Loading...
Searching...
No Matches
MultiColorLight Class Reference

#include <MultiColorLight.h>

Public Member Functions

 MultiColorLight ()
 
void begin (void)
 initialize the multicolor component
 
void setLed (uint8_t index, uint32_t color)
 Set the specified led to the passed color.
 
void setLed (leds leds, uint32_t color)
 Set the specified leds to the passed color value.
 
void setLed (leds leds, uint8_t red, uint8_t green, uint8_t blue)
 Set the specified leds to the passed color value.
 
void setTopLeds (uint32_t color)
 sets the two leds on the top of the robot to the specified color
 
void setTopLeds (uint8_t red, uint8_t green, uint8_t blue)
 sets the two leds on the top of the robot to the specified color
 
void blink (uint16_t amount, uint32_t color=0x00006400, leds leds=TOP, uint32_t interval=1000)
 Let LEDs blink, returns after all blinks were executed.
 
void turnOffLed (leds leds=ALL)
 turn off the given leds
 
uint32_t color (uint8_t r, uint8_t g, uint8_t b)
 wrapper to calulate the used colorformat from a rgb-value
 

Protected Attributes

Adafruit_NeoPixel rgbLeds
 

Static Protected Attributes

static const uint16_t ledAmount = 3
 
static const int16_t ledPin = 48
 
static const uint8_t maxBrightness = 150
 

Detailed Description

Definition at line 28 of file MultiColorLight.h.

Constructor & Destructor Documentation

◆ MultiColorLight()

MultiColorLight::MultiColorLight ( )

Definition at line 3 of file MultiColorLight.cpp.

Member Function Documentation

◆ begin()

void MultiColorLight::begin ( void )

initialize the multicolor component

Definition at line 7 of file MultiColorLight.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ blink()

void MultiColorLight::blink ( uint16_t amount,
uint32_t color = 0x00006400,
leds leds = TOP,
uint32_t interval = 1000 )

Let LEDs blink, returns after all blinks were executed.

Parameters
amounthow often should the leds blink
colorA 32-bit unsigned integer representing the color in the format 0x00RRGGBB, where RR is the red component, GG is the green component, and BB is the blue component. Each color can range between 0 to 100 Defaults to blue
ledswhich LEDs should blink, default is TOP
intervalhow many miliseconds the led is on, defaults to 1s

Definition at line 57 of file MultiColorLight.cpp.

+ Here is the call graph for this function:

◆ color()

uint32_t MultiColorLight::color ( uint8_t r,
uint8_t g,
uint8_t b )

wrapper to calulate the used colorformat from a rgb-value

Parameters
rred (0-100)
ggreen (0-100)
bblue (0-100)
Returns
A 32-bit unsigned integer representing the color in the format 0x00RRGGBB, where RR is the red component, GG is the green component, and BB is the blue component.

Definition at line 88 of file MultiColorLight.cpp.

+ Here is the caller graph for this function:

◆ setLed() [1/3]

void MultiColorLight::setLed ( leds leds,
uint32_t color )

Set the specified leds to the passed color value.

Parameters
ledswhich leds should be updated
colorA 32-bit unsigned integer representing the color in the format 0x00RRGGBB, where RR is the red component, GG is the green component, and BB is the blue component. Each color can range between 0 to 100

Definition at line 21 of file MultiColorLight.cpp.

+ Here is the call graph for this function:

◆ setLed() [2/3]

void MultiColorLight::setLed ( leds leds,
uint8_t red,
uint8_t green,
uint8_t blue )

Set the specified leds to the passed color value.

Parameters
ledswhich leds should be updated
redbrightness of red, is normalized in the function
greenbrightness of green, is normalized in the function
bluebrightness of blue, is normalized in the function

Definition at line 44 of file MultiColorLight.cpp.

+ Here is the call graph for this function:

◆ setLed() [3/3]

void MultiColorLight::setLed ( uint8_t index,
uint32_t color )

Set the specified led to the passed color.

Parameters
indexranging from 0-2, 0: Right, 1: Left, 2: Bottom
colorA 32-bit unsigned integer representing the color in the format 0x00RRGGBB, where RR is the red component, GG is the green component, and BB is the blue component. Each color can range between 0 to 100

Definition at line 12 of file MultiColorLight.cpp.

+ Here is the caller graph for this function:

◆ setTopLeds() [1/2]

void MultiColorLight::setTopLeds ( uint32_t color)

sets the two leds on the top of the robot to the specified color

Parameters
colorA 32-bit unsigned integer representing the color in the format 0x00RRGGBB, where RR is the red component, GG is the green component, and BB is the blue component. Each color can range between 0 to 100

Definition at line 49 of file MultiColorLight.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTopLeds() [2/2]

void MultiColorLight::setTopLeds ( uint8_t red,
uint8_t green,
uint8_t blue )

sets the two leds on the top of the robot to the specified color

Parameters
redbrightness of red, is normalized in the function
greenbrightness of green, is normalized in the function
bluebrightness of blue, is normalized in the function

Definition at line 53 of file MultiColorLight.cpp.

+ Here is the call graph for this function:

◆ turnOffLed()

void MultiColorLight::turnOffLed ( leds leds = ALL)

turn off the given leds

Parameters
ledswhich leds should be turned off, defaults to ALL

Definition at line 66 of file MultiColorLight.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ ledAmount

const uint16_t MultiColorLight::ledAmount = 3
staticprotected

Definition at line 30 of file MultiColorLight.h.

◆ ledPin

const int16_t MultiColorLight::ledPin = 48
staticprotected

Definition at line 31 of file MultiColorLight.h.

◆ maxBrightness

const uint8_t MultiColorLight::maxBrightness = 150
staticprotected

Definition at line 32 of file MultiColorLight.h.

◆ rgbLeds

Adafruit_NeoPixel MultiColorLight::rgbLeds
protected

Definition at line 33 of file MultiColorLight.h.


The documentation for this class was generated from the following files: