mirror of
https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
synced 2025-08-24 10:48:37 +02:00
Integrate color sensor, infrared LEDs and phototransistors into Power Management
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "ColorDetection.h"
|
||||
|
||||
void ColorDetection::begin(void){
|
||||
Power::waitForCurrentAllowance(PowerParameters::PowerConsumers::RGBW_SENSOR, PowerParameters::CurrentConsumptions::CURRENT_SENSOR_RGBW, COLOR_DETECTION_MAX_EXECUTION_DELAY_MS, NULL);
|
||||
ColorDetection::configure(VEML_CONFIG{.mode = AUTO,.enabled = true,.exposureTime=MS40});
|
||||
};
|
||||
void ColorDetection::configure(VEML_CONFIG config){
|
||||
|
@@ -11,9 +11,10 @@
|
||||
|
||||
#ifndef ColorDetection_h
|
||||
#define ColorDetection_h
|
||||
#include <stdint.h>
|
||||
#include <Wire.h>
|
||||
#include "../power/Power.h"
|
||||
#include <Arduino.h>
|
||||
#include <Wire.h>
|
||||
#include <stdint.h>
|
||||
//Definitions for I2c
|
||||
#define I2C_MASTER_SCL_IO 2 /*!< GPIO number used for I2C master clock */
|
||||
#define I2C_MASTER_SDA_IO 1 /*!< GPIO number used for I2C master data */
|
||||
@@ -28,6 +29,8 @@
|
||||
#define REG_BLUE 0x0A
|
||||
#define REG_WHITE 0x0B
|
||||
|
||||
#define COLOR_DETECTION_MAX_EXECUTION_DELAY_MS 1
|
||||
|
||||
|
||||
enum duration{
|
||||
MS40,
|
||||
|
Reference in New Issue
Block a user