Help needed in interfacing XL- MaxSonar®- AEL0™ (MB1360) to Atmega168

I'm on a project to determine the distance between two vehicles and i have used XL- MaxSonar®- AEL0™ (MB1360) (an ultrasonic device) to do it. But i'm having trouble in interfacing it to Atmega168. Can someone please help me with it. ?

I also need the codes to be burnt using an Arduino board.

and i have used XL- MaxSonar®- AEL0™ (MB1360) (an ultrasonic device)

Do you have a link to the datasheet of the sensor?

Can you post the code you have so far?

But i'm having trouble in interfacing it to Atmega168

What did you try? What did you expect, what did you get? Can you be more specific? i'm having trouble understanding :wink:

I also need the codes to be burnt using an Arduino board.

What do you mean?

I'm asking these questions to get a better understanding of your problem. The more info you can give the better help you can expect.

datasheet ==> http://www.maxbotix.com/documents/MB1260-MB1360_Datasheet.pdf

Trouble ==> if i check the output from the second pin of the sensor using a multimeter i get random readings
but, when i connect it to the 'analog pin 0' it does not display any values. :~ :~ :~

codes so far ==> #inclide<LiquidCrystal.h>
int analogPin = A0; //pin connected to analog out on maxsonar sensor
int distance; // inches away from the maxsonar sensor

void setup()
{
lcd.begin(16, 2);
pinMode(analogPin, INPUT);
}

void loop()
{
distance = analogRead(analogPin);
lcd.print("distance= ");
lcd.print(distance);

}
}

and.....about the codes......
if u hav any codes that work, pls help......