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.
HCSR04.h
00001 /* 00002 HCSR04.h 00003 Written by Leong Kum Loong. 00004 04 Dec 2017, REV. 0 00005 00006 All routines and functions in this library are written by me solely. 00007 Library for HC-SR04 Ultrasonic Ranging sensor. 00008 Library uses pins p21 to send pulse to sensor Trigger input & p22 to read sensor Echo output. 00009 This is assuming velocity of sound rate from ultrasonic pulse is 340m/s. 00010 */ 00011 00012 #ifndef HCSR04_h 00013 #define HCSR04_h 00014 #include "mbed.h" 00015 00016 //1 for CM & 2 for INCH 00017 void getDistance(int unit=1); 00018 00019 //Read current distance. 00020 float readDistance(); 00021 00022 #endif
Generated on Fri Jul 15 2022 19:16:12 by
1.7.2