10#include <driver/i2c_types.h>
19 static constexpr const char* TAG =
"Device::Colorsensor";
22 static constexpr uint8_t I2C_ADDRESS = 0x29;
23 static constexpr uint32_t I2C_CLOCK_SPEED = 400'000;
24 static constexpr uint8_t TCS34725_DEVICE_ID = 0x44;
27 i2c_master_dev_handle_t device_handle;
37 void write_register(uint8_t register_address, uint8_t value)
const;
46 [[nodiscard]] uint8_t read_register(uint8_t register_address)
const;
~Colorsensor()
Definition colorsensor.cpp:26
void initialize()
Sets up the necessary I2C channel.
Definition colorsensor.cpp:31
rgb_color_t get_color() const
Gets the color seen on last measurement.
Definition colorsensor.h:72
void measure()
Measures the current sensor values and computes them into color and brightness.
Definition colorsensor.cpp:62
Colorsensor(Robot &robot)
Definition colorsensor.cpp:18
Class containing all the components of the robot.
Definition robot.h:32
log_source
Definition log_sources.h:12
@ LOG_SOURCE_DEVICE_COLORSENSOR
Definition log_sources.h:29
Definition battery.cpp:14
A type for storing a 16-bit RGB color.
Definition rgb_color.h:14