#include<Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
int trig = 8;
int echo = 9;
float distance;
int duration;
Adafruit_SSD1306 sasu = Adafruit_SSD1306(128,64  );


void setup() {
  // put your setup code here, to run once:
sasu.begin(SSD1306_SWITCHCAPVCC,0x3c);
pinMode(trig, OUTPUT);
pinMode(echo, INPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
digitalWrite(trig, LOW);
delayMicroseconds(2);
digitalWrite(trig, HIGH);
delayMicroseconds(10);
digitalWrite(trig, LOW);


duration = pulseIn(echo,HIGH);
distance = duration * 0.034/2;










sasu.clearDisplay();  
sasu.setTextColor(WHITE);

sasu.setTextSize(2);
sasu.setCursor(0,0);
sasu.print("distance");




sasu.setTextSize(2);
sasu.setCursor(5,30);
sasu.print(distance);

sasu.display();


}