Dezibot 4
ColorDetection.h
Go to the documentation of this file.
1
15
#ifndef ColorDetection_h
16
#define ColorDetection_h
17
18
#include <stdint.h>
19
#include <Wire.h>
20
#include <Arduino.h>
21
#include <veml6040.h>
22
23
enum
duration
{
24
MS40
,
25
MS80
,
26
MS160
,
27
MS320
,
28
MS640
,
29
MS1280
30
};
31
32
enum
vemlMode
{
33
AUTO
,
34
MANUAL
35
};
36
37
struct
VEML_CONFIG
{
38
// force mode
39
vemlMode
mode
;
40
41
// chip shutdown setting
42
bool
enabled
;
43
44
// integration time
45
duration
exposureTime
;
46
};
47
48
enum
color
{
49
VEML_RED
,
50
VEML_GREEN
,
51
VEML_BLUE
,
52
VEML_WHITE
53
};
54
55
class
ColorDetection
{
56
public
:
61
void
beginAutoMode
();
62
68
void
configure
(
VEML_CONFIG
config);
69
76
uint16_t
getColorValue
(
color
color
);
77
83
float
getAmbientLight
();
84
85
protected
:
86
VEML6040
rgbwSensor
;
87
};
88
#endif //ColorDetection_h
MS80
@ MS80
Definition:
ColorDetection.h:25
vemlMode
vemlMode
Definition:
ColorDetection.h:32
VEML_WHITE
@ VEML_WHITE
Definition:
ColorDetection.h:52
VEML_CONFIG::enabled
bool enabled
Definition:
ColorDetection.h:42
MS640
@ MS640
Definition:
ColorDetection.h:28
color
color
Definition:
ColorDetection.h:48
MANUAL
@ MANUAL
Definition:
ColorDetection.h:34
MS160
@ MS160
Definition:
ColorDetection.h:26
ColorDetection::getColorValue
uint16_t getColorValue(color color)
Get color value of RGBW sensor.
Definition:
ColorDetection.cpp:43
ColorDetection::beginAutoMode
void beginAutoMode()
Start RBGW sensor with default configuration.
Definition:
ColorDetection.cpp:3
MS320
@ MS320
Definition:
ColorDetection.h:27
VEML_RED
@ VEML_RED
Definition:
ColorDetection.h:49
VEML_GREEN
@ VEML_GREEN
Definition:
ColorDetection.h:50
ColorDetection::getAmbientLight
float getAmbientLight()
Get the ambient light in lux.
Definition:
ColorDetection.cpp:59
VEML_CONFIG::exposureTime
duration exposureTime
Definition:
ColorDetection.h:45
VEML_CONFIG
Definition:
ColorDetection.h:37
AUTO
@ AUTO
Definition:
ColorDetection.h:33
ColorDetection
Definition:
ColorDetection.h:55
ColorDetection::configure
void configure(VEML_CONFIG config)
Begin RGBW sensor with passed configuration values.
Definition:
ColorDetection.cpp:11
MS40
@ MS40
Definition:
ColorDetection.h:24
VEML_BLUE
@ VEML_BLUE
Definition:
ColorDetection.h:51
MS1280
@ MS1280
Definition:
ColorDetection.h:29
ColorDetection::rgbwSensor
VEML6040 rgbwSensor
Definition:
ColorDetection.h:86
VEML_CONFIG::mode
vemlMode mode
Definition:
ColorDetection.h:39
duration
duration
Definition:
ColorDetection.h:23
src
colorDetection
ColorDetection.h
Generated by
1.8.17