Q-5-: What is the final value of the d2 variable?
const int trigPin = 9;
const int echoPin = 10;
long d1;
int d2;
void setup() {
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
Serial.begin(9600);
}
void loop() {
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
d1 = pulseIn(echoPin, HIGH);
d2 = d1*0.034/2;
Serial.println(d2);
}