#include "Arduino.h" #include #define TRIG_PIN 12 #define ECHO_PIN 11 HCSR04 sr04(TRIG_PIN,ECHO_PIN); long a; //The setup function is called once at startup of the sketch void setup() { // Add your initialization code here Serial.begin(9600); Serial.println(__FILE__); delay(1000); } // The loop function is called in an endless loop void loop() { //Add your repeated code here a=sr04.distanceInMillimeters(); Serial.print(a); Serial.println("mm"); delay(1000); }