Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
IRSensor Class Reference
This class implements a driver to read the distance sensors of the ROME2 mobile robot. More...
#include <IRSensor.h>
Public Member Functions | |
IRSensor (AnalogIn &distance, DigitalOut &bit0, DigitalOut &bit1, DigitalOut &bit2, int number) | |
Creates and initialises the driver to read the distance sensors. | |
virtual | ~IRSensor () |
Deletes this IRSensor object and releases all allocated resources. | |
float | read () |
This method reads from the distance sensor. | |
operator float () | |
The empty operator is a shorthand notation of the read() method. |
Detailed Description
This class implements a driver to read the distance sensors of the ROME2 mobile robot.
Definition at line 17 of file IRSensor.h.
Constructor & Destructor Documentation
IRSensor | ( | AnalogIn & | distance, |
DigitalOut & | bit0, | ||
DigitalOut & | bit1, | ||
DigitalOut & | bit2, | ||
int | number | ||
) |
Creates and initialises the driver to read the distance sensors.
- Parameters:
-
distance the analog input to read a distance value from. bit0 a digital output to control the multiplexer. bit1 a digital output to control the multiplexer. bit2 a digital output to control the multiplexer. number the number of the sensor. This value must be between 0 and 5.
Definition at line 20 of file IRSensor.cpp.
~IRSensor | ( | ) | [virtual] |
Deletes this IRSensor object and releases all allocated resources.
Definition at line 28 of file IRSensor.cpp.
Member Function Documentation
operator float | ( | ) |
The empty operator is a shorthand notation of the read()
method.
Definition at line 48 of file IRSensor.cpp.
float read | ( | ) |
This method reads from the distance sensor.
- Returns:
- a distance value, given in [m].
Definition at line 34 of file IRSensor.cpp.
Generated on Wed Jul 20 2022 03:42:12 by
