Ultrasonic Range Finder Sensors Library. May be used for SRF05 and all others sensors of the same kind (50ms period, 10us pulse)
Dependents: FRC_2018 TestVMA 0hackton_08_06_18 lib_FRC_2019 ... more
Diff: VMA306.h
- Revision:
- 1:4f394d75bc7f
- Parent:
- 0:bc016581f12b
- Child:
- 3:4d9c742b860b
--- a/VMA306.h Mon May 21 12:37:44 2018 +0000 +++ b/VMA306.h Tue May 22 17:04:02 2018 +0000 @@ -26,47 +26,48 @@ * Vellerman VMA306 Ultrasonic Range Finder Library * * @Note : - * The purpose of this library is to adapt SRF05 library to allow full control - * of the sensor : + * The purpose of this library is to adapt SRF05 library to allow full control of the sensor : * - allow cycle control (time between 2 pulses) * - delayed trigerring (start periodical mesurement with a delay) - * because in case of multiple US sensor use, pulse from a sensor can be - * detected by another like its own echo and thus interfere with mesurment. + * because in case of multiple US sensor use, pulse from a sensor can be detected by another like its own echo and thus interfere with mesurement. * * Cycle time must be greater or equal to 50ms. * After 30ms the sensor times out so 30ms output pulse means no detection * - * You may divide the echo pulse width by 58µs/cm to calculate the almost - * exact distance to the obstacle. + * You may divide the echo pulse width by 58µs/cm to calculate the almost exact distance to the obstacle in centimeters. * - * To allow non blocking read you may use the global variable VMA306Flag witch - * is set to one each time a new mesure is ready + * To allow non blocking read you may use the global variable VMA306Flag witch is set to one each time a new mesure is ready. This variable must be cleared by user */ #ifndef _VMA306_H #define _VMA306_H +/** + * Includes : Mbed Library + */ #include "mbed.h" +/** + * VMA306 Ultrasonic Range Finder + * similar to SRF05 : https://www.robot-electronics.co.uk/htm/srf05tech.htm + * Poor documentation can be found here (FR) : https://www.gotronic.fr/art-capteur-a-ultrasons-vma306-26096.htm + */ class VMA306 { public: - /** Create a VMA306 object, connected to the specified pins + /** Constructor : Create a VMA306 object, connected to the specified pins * - * @param trigger DigitalOut to the VMA306 trigger - * @param echo InterruptIn to measure the return pulse + * @param trigger : DigitalOut to the VMA306 trigger + * @param echo : InterruptIn to measure the return pulse */ VMA306(PinName trigger, PinName echo); /** Start periodic Trigger * - * @param period float time in second between two trig pulses + * @param period : float time in second between two trig pulses * - * This function allows user to start each instance of Ultra Sonic range - * finder with a delay from the others (delay managment must be done by - * users). - * - * The first pulse will be send 1 period after. + * @note This function allows user to start each instance of Ultra Sonic range finder with a delay from the others (delay managment must be done by users). + * @note The first pulse will be send 1 period after. */ void startPeriodicTrigger (float period = 0.15);