#ifndef _IR_SENSOR_H
#define _IR_SENSOR_H
#include "../../defines.h"
#include "../../robot.h"
#include "sensor.h"
class IR_Sensor : public Sensor
{
public:
IR_Sensor()
this->parent = NULL;
this->moduleId = 0;
this->intensityCorrection = 0;
}
IR_Sensor(uint32 sensorId)
this->moduleId = sensorId;
switch(sensorId)
case IO_SENSOR_IR_0_DEG:
this->channel = 0;
break;
case IO_SENSOR_IR_30_DEG:
this->channel = 1;
case IO_SENSOR_IR_60_DEG:
this->channel = 2;
case IO_SENSOR_IR_100_DEG:
this->channel = 3;
this->intensityCorrection = 80;
case IO_SENSOR_IR_180_DEG:
this->channel = 4;
this->intensityCorrection = 70;
case IO_SENSOR_IR_260_DEG:
this->channel = 5;
case IO_SENSOR_IR_300_DEG:
this->channel = 6;
case IO_SENSOR_IR_330_DEG:
this->channel = 7;
default:
this->channel = 8;
protected:
//Hardware
uint8 channel;
uint8 intensityCorrection;
uint16 GetIRIntensity();
};
#endif