SR-04P超音波
Last updated
Last updated
#include <HCSR04.h>
HCSR04 hc(3,4);//initialisation class HCSR04 (trig pin , echo pin)
void setup()
{ Serial.begin(9600); }
void loop()
{ Serial.println( hc.dist() );
delay(500);
}//return curent distance in serial