Go Down

Topic: [HELP] Interfacing HCSR04 to VB.NET (Read 558 times) previous topic - next topic

I am creating a Parking System. I use Ultrasonic Sensor to sense if there is a Car Parked to a Parking Slot.

Here is my Arduino Sketch.

Code: [Select]

#define trigPin 3
#define echoPin 2

void setup() {
 Serial.begin (9600);
 pinMode(trigPin, OUTPUT);
 pinMode(echoPin, INPUT);
}

void loop() {
 int duration, distance;
 digitalWrite(trigPin, HIGH);
 delayMicroseconds(1000);
 digitalWrite(trigPin, LOW);
 duration = pulseIn(echoPin, HIGH);
 distance = (duration/2) / 29.1;
 Serial.print(distance);
 Serial.println(" cm");
 delay(100);
}


How can I read the Distance Values for VB.NET. I really need Help . THANK YOU .


Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy