#include <NewPing.h>
#define ECHO_PIN 8
#define TRIGGER_PIN 7
#define MAX_LENGTH 200
NewPing sonar (TRIGGER_PIN, ECHO_PIN, MAX_LENGTH);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println("Politeknik Negeri Jember");
delay(1000);
}
void loop() {
// put your main code here, to run repeatedly:
delay(1000);
Serial.print("Jarak = ");
Serial.print(sonar.ping_cm());
Serial.println(" cm");
}