11#include <soc/gpio_num.h>
19 static constexpr const char* TAG =
"Device::Leds";
21 static constexpr uint8_t NUM_LEDS = 4;
22 static constexpr gpio_num_t MOSI_PIN = GPIO_NUM_23;
23 static constexpr gpio_num_t SCK_PIN = GPIO_NUM_18;
29 void send_bit(
bool bit)
const;
30 void send_byte(uint8_t
byte)
const;
void set_color_all(rgb_color_t color)
Sets the color of all LEDs.
Definition leds.cpp:68
Leds(Robot &robot)
Definition leds.cpp:15
void turn_all_off()
Turns off all LEDs.
Definition leds.cpp:83
void update() const
Updates the physical LEDs.
Definition leds.cpp:55
void shutdown()
Prepares the LEDs for a shut-down state, for example for getting destroyed or entering deep sleep.
Definition leds.cpp:51
void initialize()
Sets up the neccessary GPIO pins.
Definition leds.cpp:27
void turn_off(led_id_t led_id, bool do_update=true)
Turns off a specific LED.
Definition leds.cpp:76
~Leds()
Definition leds.cpp:22
void set_color(led_id_t led_id, rgb_color_t color, bool do_update=true)
Sets the color of a specific LED.
Definition leds.cpp:61
led_id_t
Definition leds.h:34
@ BACK_LEFT
Definition leds.h:37
@ FRONT_LEFT
Definition leds.h:35
@ FRONT_RIGHT
Definition leds.h:36
@ BACK_RIGHT
Definition leds.h:38
Class containing all the components of the robot.
Definition robot.h:24
Definition battery.cpp:14
A type for storing a 16-bit RGB color.
Definition rgb_color.h:14