|
Dezibot 4
|
Go to the documentation of this file.
28 uint16_t maxReading = 0;
29 uint16_t currentReading = 0;
33 for(
const auto pt : allIRPTs){
35 if (currentReading > maxReading){
36 maxReading = currentReading;
42 for(
const auto pt : allDLPTs){
44 if (currentReading > maxReading){
45 maxReading = currentReading;
56 TickType_t xLastWakeTime = xTaskGetTickCount();
57 TickType_t frequency = timeBetween / portTICK_PERIOD_MS;
58 uint64_t cumulatedResult = 0;
59 for(
int i = 0; i < measurments; i++){
61 xTaskDelayUntil(&xLastWakeTime,frequency);
63 return cumulatedResult/measurments;
static const uint8_t IR_PT_BACK_ADC
static void begin(void)
initialize the Lightdetection Compnent, must be called before the other methods are used.
static const uint8_t IR_PT_LEFT_ADC
static void beginDaylight(void)
static const uint8_t DL_PT_BOTTOM_ADC
static uint16_t getValue(photoTransistors sensor)
reads the Value of the specified sensor
static const uint8_t DL_PT_FRONT_ADC
static const uint8_t IR_PT_RIGHT_ADC
static const uint8_t IR_PT_FRONT_ADC
static void beginInfrared(void)
static photoTransistors getBrightest(ptType type)
can be used to determine which sensor is exposed to the greatest amount of light Can distingish betwe...
static uint16_t readIRPT(photoTransistors sensor)
Class for Reading the values of the different Phototransistors, both IR, and DaylightSensors are supp...
static const uint8_t IR_PT_ENABLE
static uint32_t getAverageValue(photoTransistors sensor, uint32_t measurments, uint32_t timeBetween)
Get the Average of multiple measurments of a single PT.
static uint16_t readDLPT(photoTransistors sensor)
static const uint8_t DL_PT_ENABLE