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

#include <colorsensor.h>

Public Member Functions

 Colorsensor (Robot &robot)
 ~Colorsensor ()
void initialize ()
 Sets up the necessary I2C channel.
void measure ()
 Measures the current sensor values and computes them into color and brightness.
rgb_color_t get_color () const
 Gets the color seen on last measurement.

Constructor & Destructor Documentation

◆ Colorsensor()

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

◆ ~Colorsensor()

Device::Colorsensor::~Colorsensor ( )

Member Function Documentation

◆ get_color()

rgb_color_t Device::Colorsensor::get_color ( ) const
inlinenodiscard

Gets the color seen on last measurement.

Note
The color of the return is of the type rgb_color_t, but is always picked from predef_color.h
Returns
The color formatted as a rgb_color_t

◆ initialize()

void Device::Colorsensor::initialize ( )

Sets up the necessary I2C channel.

◆ measure()

void Device::Colorsensor::measure ( )

Measures the current sensor values and computes them into color and brightness.


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