ATtiny85 + Ultrasonic Sensor

Hello, help me out here. How to program ATtiny85 with a Ultrasonic Sensor (SEN136B5B) ?

When i uploaded the code, it shows 'serial' is not declared in this scope.

My code is :

const int pingPin = 0;

void setup()
{
Serial.begin(9600);
}

void loop()
{
long duration, meters, cm;

pinMode(pingPin, OUTPUT);
digitalWrite(pingPin, LOW);
delayMicroseconds(2);
digitalWrite(pingPin, HIGH);
delayMicroseconds(5);
digitalWrite(pingPin, LOW);

pinMode(pingPin, INPUT);
duration = pulseIn(pingPin, HIGH);

meters = microsecondsToMeters(duration);
cm = microsecondsToCentimeters(duration);

Serial.print(meters);
Serial.print("m, ");
Serial.print(cm);
Serial.print("cm");
Serial.println();

delay(100);

}

long microsecondsToMeters(long microseconds)

{

return microseconds / 74 / 2;

}

long microsecondsToCentimeters(long microseconds)

{

return microseconds / 29 / 2;

}

Attiny85's don't have serial communication. Give this a read: Communication with Tiny's

Do not cross-post. Threads merged.