mirror of
https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
synced 2025-08-24 18:58:36 +02:00
Merge branch display into release
This commit is contained in:
@@ -52,6 +52,7 @@ photoTransistors LightDetection::getBrightest(ptType type){
|
||||
};
|
||||
|
||||
uint32_t LightDetection::getAverageValue(photoTransistors sensor, uint32_t measurments, uint32_t timeBetween){
|
||||
|
||||
TickType_t xLastWakeTime = xTaskGetTickCount();
|
||||
TickType_t frequency = timeBetween / portTICK_PERIOD_MS;
|
||||
uint64_t cumulatedResult = 0;
|
||||
@@ -63,6 +64,7 @@ uint32_t LightDetection::getAverageValue(photoTransistors sensor, uint32_t measu
|
||||
};
|
||||
|
||||
void LightDetection::beginInfrared(void){
|
||||
digitalWrite(IR_PT_ENABLE,true);
|
||||
pinMode(IR_PT_ENABLE, OUTPUT);
|
||||
pinMode(IR_PT_FRONT_ADC, INPUT);
|
||||
pinMode(IR_PT_LEFT_ADC, INPUT);
|
||||
@@ -71,13 +73,14 @@ void LightDetection::beginInfrared(void){
|
||||
};
|
||||
|
||||
void LightDetection::beginDaylight(void){
|
||||
digitalWrite(DL_PT_ENABLE,true);
|
||||
pinMode(DL_PT_ENABLE, OUTPUT);
|
||||
pinMode(DL_PT_BOTTOM_ADC, INPUT);
|
||||
pinMode(DL_PT_FRONT_ADC, INPUT );
|
||||
};
|
||||
|
||||
uint16_t LightDetection::readIRPT(photoTransistors sensor){
|
||||
digitalWrite(IR_PT_ENABLE,HIGH);
|
||||
//digitalWrite(IR_PT_ENABLE,HIGH);
|
||||
uint16_t result = 0;
|
||||
switch (sensor)
|
||||
{
|
||||
@@ -96,7 +99,7 @@ uint16_t LightDetection::readIRPT(photoTransistors sensor){
|
||||
default:
|
||||
break;
|
||||
}
|
||||
digitalWrite(IR_PT_ENABLE,LOW);
|
||||
//digitalWrite(IR_PT_ENABLE,LOW);
|
||||
return result;
|
||||
};
|
||||
|
||||
|
@@ -91,13 +91,7 @@ protected:
|
||||
static void beginInfrared(void);
|
||||
static void beginDaylight(void);
|
||||
static uint16_t readIRPT(photoTransistors sensor);
|
||||
static uint16_t readDLPT(photoTransistors sensor);
|
||||
|
||||
static void averageMeasurmentTask(void * args);
|
||||
|
||||
|
||||
|
||||
|
||||
static uint16_t readDLPT(photoTransistors sensor);
|
||||
|
||||
};
|
||||
#endif //LightDetection_h
|
Reference in New Issue
Block a user