bargraph ultrasonic ranging

Hi, I’m newbie to arduino, does anyone know how to add smooth range bargraph meter on the second line with 2x16 LCD to that code?

LiquidCrystal lcd(8, 9, 4, 5, 6, 7); int pingPin = 13; int inPin = 12;
void setup() { lcd.begin(16, 2); lcd.print(“testing…”); }
void loop() {
long duration, inches, cm; pinMode(pingPin, OUTPUT); digitalWrite(pingPin, LOW); delayMicroseconds(2); digitalWrite(pingPin, HIGH); delayMicroseconds(10); digitalWrite(pingPin, LOW);
pinMode(inPin, INPUT); duration = pulseIn(inPin, HIGH);
inches = microsecondsToInches(duration); cm = microsecondsToCentimeters(duration); lcd.clear(); lcd.setCursor(0, 0); lcd.print(inches); lcd.print("in, "); lcd.print(cm); lcd.print(“cm”);
delay(100); }
long microsecondsToInches(long microseconds) {
return microseconds / 74 / 2; }
long microsecondsToCentimeters(long microseconds) { return microseconds / 29 / 2; }

Many thanks for any suggestions.

I have a double-line bar graph in this project code. Maybe you can modify the code to do single line bar graph.

People don’t write code the way you posted on your thread. Please don’t write more than one statement in one line and use the “#” button to post code.