Use this repository for pilot an ultrasonic sensor

Fork of UltrasonicSensor by Daniele Briguglio

Files at this revision

API Documentation at this revision

Comitter:
danky02
Date:
Mon Jan 15 21:12:25 2018 +0000
Parent:
0:8ca9f71b386d
Commit message:
Use this library for pilot an ultrasonic sensor

Changed in this revision

UltrasonicSensor.h Show annotated file Show diff for this revision Revisions of this file
--- a/UltrasonicSensor.h	Mon Jan 15 20:35:11 2018 +0000
+++ b/UltrasonicSensor.h	Mon Jan 15 21:12:25 2018 +0000
@@ -25,6 +25,29 @@
 #include <mbed.h>
 
 namespace mbed {
+/** \addtogroup drivers */
+
+/**
+ * @note UltrasonicSensor
+ *
+ * Example:
+ * @code
+ * #include "mbed.h"
+ * #include "UltrasonicSensor.h"
+ *
+ * UltrasonicSensor sensor(D9, D8); //declare echo pin and trigger pin (echo, trigger)
+ 
+ * int main(){
+ *   sensor.begin(); //begin the ultrasonic sensor
+ *   while(1) {
+ *     float dist = sensor.read(); //read distance from ultrasonic sensor in cm
+ *     printf("%f cm \n\r", dist);
+ *     wait(0.5);
+ *   }
+ * }
+ * @endcode
+ * @ingroup drivers
+ */
     
 class UltrasonicSensor {