Driver for Me ultrasonic sensor device.
More...
#include <src/MeUltrasonicSensor.h>
Driver for Me ultrasonic sensor device.
Class: MeUltrasonicSensor
- Description
- Declaration of Class MeUltrasonicSensor.
- Copyright (C), 2012-2016, MakeBlock
◆ MeUltrasonicSensor() [1/2]
| MeUltrasonicSensor::MeUltrasonicSensor |
( |
void |
| ) |
|
Alternate Constructor which can call your own function to map the ultrasonic sensor to arduino port, no pins are used or initialized here.
- Parameters
-
◆ MeUltrasonicSensor() [2/2]
| MeUltrasonicSensor::MeUltrasonicSensor |
( |
uint8_t |
port | ) |
|
Alternate Constructor which can call your own function to map the ultrasonic Sensor to arduino port
- Parameters
-
| [in] | port | - RJ25 port from PORT_1 to M2 |
◆ distanceCm()
| double MeUltrasonicSensor::distanceCm |
( |
uint16_t |
MAXcm = 400 | ) |
|
- Function
- distanceCm
- Description
- Centimeters return the distance
- Parameters
-
| [in] | MAXcm | - The Max centimeters can be measured, the default value is 400. |
- Output
- None
- Returns
- The distance measurement in centimeters
- Others
- None
◆ distanceInch()
| double MeUltrasonicSensor::distanceInch |
( |
uint16_t |
MAXinch = 180 | ) |
|
- Function
- distanceInch
- Description
- Inch return the distance
- Parameters
-
| [in] | MAXinch | - The Max inch can be measured, the default value is 180. |
- Output
- None
- Returns
- The distance measurement in inch
- Others
- None
◆ measure()
| long MeUltrasonicSensor::measure |
( |
unsigned long |
timeout = 30000 | ) |
|
- Function
- measure
- Description
- To get the duration of the ultrasonic sensor
- Parameters
-
| [in] | timeout | - This value is used to define the measurement range, The default value is 30000. |
- Output
- None
- Returns
- The duration value associated with distance
- Others
- None
◆ setpin()
| void MeUltrasonicSensor::setpin |
( |
uint8_t |
SignalPin | ) |
|
- Function
- setpin
- Description
- Reset the ultrasonic Sensor available PIN by its arduino port.
- Parameters
-
| [in] | SignalPin | - arduino port for sensor read(should analog pin) |
- Output
- None
- Returns
- None
- Others
- None
The documentation for this class was generated from the following files: