#include <Servo.h>
Servo myservo;
const int TRIGPIN = 8;
const int ECHOPIN = 9;
long timer;
int jarak;
int pos = 00;
void setup() {
// put your setup code here, to run once:
pinMode(ECHOPIN, INPUT);
pinMode(TRIGPIN, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(TRIGPIN, LOW);
delayMicroseconds(2);
digitalWrite(TRIGPIN, HIGH);
delayMicroseconds(10);
digitalWrite(TRIGPIN, LOW);
timer = pulseIn(ECHOPIN, HIGH)
jarak = timer/58
delay(1000);
}