超音波
易于使用的Arduino超声波库,带或不带温度补偿
HC-SR04说明:
除其他外,我在Arduino水箱中使用液位测量:
用:
# include " Ultraschall.h "
Ultraschall ultra ( 7 , 8 );
void setup () {
Serial. begin ( 9600 );
while (!Serial) {;}
Serial. println ( " Ultraschall Test " );
Serial. println ( " distance in cm: " );
}
void loop () {
// /for uncompensated distance in cm
Serial. print (ultra. getDistanceInCM ());
Serial. print (
2022-04-09 10:36:54
4KB
C++
1