JM9 XRCU Board 0.1.0
Libraries API Reference
Loading...
Searching...
No Matches
Color_sensor.h File Reference
#include <Arduino.h>
#include <Wire.h>
#include <Supported_sensor.h>

Go to the source code of this file.

Classes

struct  rgbc_t
 An RGBC color. More...
 
struct  hsl_t
 An HSL color. More...
 
struct  rgb_t
 An RGB-888 color. More...
 
class  Color_sensor
 PKS Color Sensor Driver for XRCU. More...
 

Enumerations

enum  color_t {
  black = 0 , white = 1 , grey = 2 , red = 3 ,
  green = 4 , blue = 5 , yellow = 6 , cyan = 7 ,
  magenta = 8
}
 Colors returnable by Color_sensor::get_color(). More...
 

Functions

uint16_t rgb888_to_rgb565 (rgb_t rgb888)
 Converts an RGB-888 color to an RGB-565 color.
 

Detailed Description

Color_sensor.h - PKS Color Sensor Driver for XRCU.

Note
DISCLAIMER:
The hardware of this sensor is not provided by Journey Maker 9 Systems.
Performance and stability could not be guaranteed to JM9 competition standards.
Consult hardware distributor before using this sensor in critical competitions.

Enumeration Type Documentation

◆ color_t

enum color_t

Colors returnable by Color_sensor::get_color().

The following is a color code returned by the get_color function of this color sensor only.
Do not mix it with the RGB565 color scheme used by the monitor driver ST7735.
Colors used by monitor look like #define ST7735_RED 0xF800.

Note
DISCLAIMER:
The hardware of this sensor is not provided by Journey Maker 9 Systems.
Performance and stability could not be guaranteed to JM9 competition standards.
Consult hardware distributor before using this sensor in critical competitions.
Author
YH Choi @ JM9
See also
Color_sensor::get_color()

Function Documentation

◆ rgb888_to_rgb565()

uint16_t rgb888_to_rgb565 ( rgb_t rgb888)

Converts an RGB-888 color to an RGB-565 color.

Parameters
rgb888the RGB-888 color to be converted
Returns
the converted RGB-565 color

Color_sensor.cpp - PKS Color Sensor Driver for XRCU. Copyright (c) 2024 - 2025 YH Choi @ JM9. All right reserved.