int trigpin = A0;
int echopin = A1;
float distance;
float duration;
void setup()
{
pinmode(trigpin), OUTPUT);
pinmode(echopin), INPUT;
Serial.begin(9600);
}
void loop()
{
digitalWrite(trigpin, LOW);
delay(2);
digitalWrite(trigpin, HIGH);
delayMicroseconds(10);
digitalWrite(trigpin, LOW);
duration = pulseIn(echopin, HIGH);
distance = (duration*0.034)/2;
Serial.print("The Distance is = ");
Serial.print(distance);
Serial.print("cm")
delay(500);
}
And the problem is? Please provide details.
Please use the English language in the English sections of the forum. Use something like google translate if needed.
Your topic does not indicate a problem with IDE 2.x and hence has been moved to a more suitable location of the forum.
fiso42
3
The title says something like "do not disturb".
Makes no sense.
system
Closed
5
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.