Boboter
Loading...
Searching...
No Matches
Device::Leds Class Reference

#include <leds.h>

Public Types

enum class  led_id_t : uint8_t { FRONT_LEFT = 0 , FRONT_RIGHT = 1 , BACK_LEFT = 2 , BACK_RIGHT = 3 }

Public Member Functions

 Leds (Robot &robot)
 ~Leds ()
void initialize ()
 Sets up the neccessary GPIO pins.
void shutdown ()
 Prepares the LEDs for a shut-down state, for example for getting destroyed or entering deep sleep.
void update () const
 Updates the physical LEDs.
void set_color (led_id_t led_id, rgb_color_t color, bool do_update=true)
 Sets the color of a specific LED.
void set_color_all (rgb_color_t color)
 Sets the color of all LEDs.
void turn_off (led_id_t led_id, bool do_update=true)
 Turns off a specific LED.
void turn_all_off ()
 Turns off all LEDs.

Member Enumeration Documentation

◆ led_id_t

enum class Device::Leds::led_id_t : uint8_t
strong
Enumerator
FRONT_LEFT 
FRONT_RIGHT 
BACK_LEFT 
BACK_RIGHT 

Constructor & Destructor Documentation

◆ Leds()

Device::Leds::Leds ( Robot & robot)
explicit

◆ ~Leds()

Device::Leds::~Leds ( )

Member Function Documentation

◆ initialize()

void Device::Leds::initialize ( )

Sets up the neccessary GPIO pins.

◆ set_color()

void Device::Leds::set_color ( led_id_t led_id,
rgb_color_t color,
bool do_update = true )

Sets the color of a specific LED.

Parameters
led_idThe ID of the LED of which to set the color
colorThe color to set that LED to
do_updateDecides if the function automatically updates the LEDs or not (default: true)

◆ set_color_all()

void Device::Leds::set_color_all ( rgb_color_t color)

Sets the color of all LEDs.

Parameters
colorThe color to set to

◆ shutdown()

void Device::Leds::shutdown ( )

Prepares the LEDs for a shut-down state, for example for getting destroyed or entering deep sleep.

◆ turn_all_off()

void Device::Leds::turn_all_off ( )

Turns off all LEDs.

◆ turn_off()

void Device::Leds::turn_off ( led_id_t led_id,
bool do_update = true )

Turns off a specific LED.

Parameters
led_idThe ID of the LED to turn off
do_updateDecides if the function automatically updates the LEDs or not (default: true)

◆ update()

void Device::Leds::update ( ) const

Updates the physical LEDs.


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