Dezibot 4
LightDetection Class Reference

#include <LightDetection.h>

Static Public Member Functions

static void begin (void)
 initialize the Lightdetection Compnent, must be called before the other methods are used.
More...
 
static uint16_t getValue (photoTransistors sensor)
 reads the Value of the specified sensor More...
 
static photoTransistors getBrightest (ptType type)
 can be used to determine which sensor is exposed to the greatest amount of light Can distingish between IR and Daylight More...
 
static uint32_t getAverageValue (photoTransistors sensor, uint32_t measurments, uint32_t timeBetween)
 Get the Average of multiple measurments of a single PT. More...
 

Static Protected Member Functions

static void beginInfrared (void)
 
static void beginDaylight (void)
 
static uint16_t readIRPT (photoTransistors sensor)
 
static uint16_t readDLPT (photoTransistors sensor)
 

Static Protected Attributes

static const uint8_t IR_PT_FRONT_ADC = 3
 
static const uint8_t IR_PT_LEFT_ADC = 4
 
static const uint8_t IR_PT_RIGHT_ADC = 5
 
static const uint8_t IR_PT_BACK_ADC = 6
 
static const uint8_t DL_PT_FRONT_ADC = 7
 
static const uint8_t DL_PT_BOTTOM_ADC = 8
 
static const uint8_t DL_PT_ENABLE = 41
 
static const uint8_t IR_PT_ENABLE = 40
 

Detailed Description

Definition at line 44 of file LightDetection.h.

Member Function Documentation

◆ begin()

void LightDetection::begin ( void  )
static

initialize the Lightdetection Compnent, must be called before the other methods are used.

Definition at line 4 of file LightDetection.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ beginDaylight()

void LightDetection::beginDaylight ( void  )
staticprotected

Definition at line 75 of file LightDetection.cpp.

+ Here is the caller graph for this function:

◆ beginInfrared()

void LightDetection::beginInfrared ( void  )
staticprotected

Definition at line 66 of file LightDetection.cpp.

+ Here is the caller graph for this function:

◆ getAverageValue()

uint32_t LightDetection::getAverageValue ( photoTransistors  sensor,
uint32_t  measurments,
uint32_t  timeBetween 
)
static

Get the Average of multiple measurments of a single PT.

Parameters
sensorWhich Phototransistor should be read
measurmentshow many measurements should be taken
timeBetweenwhich time should elapse between
Returns
the average of all taken meaurments

Definition at line 54 of file LightDetection.cpp.

+ Here is the call graph for this function:

◆ getBrightest()

photoTransistors LightDetection::getBrightest ( ptType  type)
static

can be used to determine which sensor is exposed to the greatest amount of light Can distingish between IR and Daylight

Parameters
typeselect which PTTransistors to compare
Returns
photoTransistors which sensor is exposed to the greatest amount of light, if all sensor read 0, the front sensor is returned

Definition at line 26 of file LightDetection.cpp.

◆ getValue()

uint16_t LightDetection::getValue ( photoTransistors  sensor)
static

reads the Value of the specified sensor

Parameters
sensorwhich sensor to read
Returns
uint the reading of the sensor. between 0-4095

Definition at line 9 of file LightDetection.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readDLPT()

uint16_t LightDetection::readDLPT ( photoTransistors  sensor)
staticprotected

Definition at line 106 of file LightDetection.cpp.

+ Here is the caller graph for this function:

◆ readIRPT()

uint16_t LightDetection::readIRPT ( photoTransistors  sensor)
staticprotected

Definition at line 82 of file LightDetection.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ DL_PT_BOTTOM_ADC

const uint8_t LightDetection::DL_PT_BOTTOM_ADC = 8
staticprotected

Definition at line 85 of file LightDetection.h.

◆ DL_PT_ENABLE

const uint8_t LightDetection::DL_PT_ENABLE = 41
staticprotected

Definition at line 87 of file LightDetection.h.

◆ DL_PT_FRONT_ADC

const uint8_t LightDetection::DL_PT_FRONT_ADC = 7
staticprotected

Definition at line 84 of file LightDetection.h.

◆ IR_PT_BACK_ADC

const uint8_t LightDetection::IR_PT_BACK_ADC = 6
staticprotected

Definition at line 82 of file LightDetection.h.

◆ IR_PT_ENABLE

const uint8_t LightDetection::IR_PT_ENABLE = 40
staticprotected

Definition at line 88 of file LightDetection.h.

◆ IR_PT_FRONT_ADC

const uint8_t LightDetection::IR_PT_FRONT_ADC = 3
staticprotected

Definition at line 79 of file LightDetection.h.

◆ IR_PT_LEFT_ADC

const uint8_t LightDetection::IR_PT_LEFT_ADC = 4
staticprotected

Definition at line 80 of file LightDetection.h.

◆ IR_PT_RIGHT_ADC

const uint8_t LightDetection::IR_PT_RIGHT_ADC = 5
staticprotected

Definition at line 81 of file LightDetection.h.


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