MRMS
Public Member Functions | List of all members
Mrm_ir_finder2 Class Reference

Public Member Functions

 Mrm_ir_finder2 (Robot *robot)
 
void add (uint8_t anglePin, uint8_t distancePin)
 
bool anyIRSource (uint8_t sensorNumber=0)
 
IRSource irSource (uint8_t sensorNumber=0)
 
void test (bool updateByTimerInterrupts=false)
 

Constructor & Destructor Documentation

◆ Mrm_ir_finder2()

Mrm_ir_finder2::Mrm_ir_finder2 ( Robot robot)

Constructor

Parameters
robot- robot containing this board

Member Function Documentation

◆ add()

void Mrm_ir_finder2::add ( uint8_t  anglePin,
uint8_t  distancePin 
)

Add a sensor

Parameters
anglePin- Analog pin for angle. Robot front is 0 degrees and positive angles are to the right. Total range is -180º to 180º.
distancePin- analog pin for distance.

Add a sensor

Parameters
angle- Analog pin for angle. Robot front is 0 degrees and positive angles are to the right. Total range is -180º to 180º.
distance- analog pin for distance.

◆ anyIRSource()

bool Mrm_ir_finder2::anyIRSource ( uint8_t  sensorNumber = 0)

Does a light source exist (like an RCJ IR ball) or not?

Parameters
sensorNumber- Sensor's ordinal number. Each call of function add() assigns an increasing number to the sensor, starting with 0.
Returns
- Exists or not.

◆ irSource()

IRSource Mrm_ir_finder2::irSource ( uint8_t  sensorNumber = 0)

Angle of the light source (like an RCJ IR ball)

Returns
- Angle in degrees. Robot front is 0 degrees and positive angles are to the right. Total range is -180º to 180º.
Parameters
sensorNumber- Sensor's ordinal number. Each call of function add() assigns an increasing number to the sensor, starting with 0.

Angle of the light source (like an RCJ IR ball)

Parameters
sensorNumber- Sensor's ordinal number. Each call of function add() assigns an increasing number to the sensor, starting with 0.
Returns
- Angle in degrees. Robot front is 0 degrees and positive angles are to the right. Total range is -180º to 180º.

◆ test()

void Mrm_ir_finder2::test ( bool  updateByTimerInterrupts = false)

Test

Parameters
updateByTimerInterrupts- If so, no update() will be called in the function.

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