Paso 6: Añadir código de prueba
#include < NewPing.h >
#define TRIGGER_PIN 12;
#define ECHO_PIN 11;
#define MAX_DISTANCE 200;
Sonar de NewPing (TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);
void setup() {}
Serial.Begin(115200);
}
void loop() {}
Delay(50);
unsigned int nos = sonar.ping();
Serial.Print ("Ping:");
Serial.Print(US / US_ROUNDTRIP_CM);
Serial.println("cm");
}