10#include <soc/gpio_num.h>
21 static constexpr const char* TAG =
"Device::Leds";
24 static constexpr uint8_t NUM_LEDS = 4;
25 static constexpr gpio_num_t MOSI_PIN = GPIO_NUM_23;
26 static constexpr gpio_num_t SCK_PIN = GPIO_NUM_18;
34 void send_bit(
bool bit)
const;
35 void send_byte(uint8_t
byte)
const;
void set_color_all(rgb_color_t color)
Sets the color of all LEDs.
Definition leds.cpp:80
Leds(Robot &robot)
Definition leds.cpp:15
void turn_all_off()
Turns off all LEDs.
Definition leds.cpp:95
void update() const
Updates the physical LEDs.
Definition leds.cpp:59
void shutdown()
Prepares the LEDs for a shut-down state, for example for getting destroyed or entering deep sleep.
Definition leds.cpp:54
void initialize()
Sets up the necessary 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:88
~Leds()
Definition leds.cpp:22
led_id_t
Definition leds.h:39
@ BACK_LEFT
Definition leds.h:42
@ FRONT_LEFT
Definition leds.h:40
@ FRONT_RIGHT
Definition leds.h:41
@ BACK_RIGHT
Definition leds.h:43
void set_color(led_id_t led_id, rgb_color_t color, bool do_update=false)
Sets the color of a specific LED.
Definition leds.cpp:71
Class containing all the components of the robot.
Definition robot.h:32
log_source
Definition log_sources.h:12
@ LOG_SOURCE_DEVICE_LEDS
Definition log_sources.h:20
Definition battery.cpp:14
A type for storing a 16-bit RGB color.
Definition rgb_color.h:14