Go Down

Topic: [HELP] Interfacing HCSR04 to VB.NET (Read 1 time) 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);
 digitalWrite(trigPin, LOW);
 duration = pulseIn(echoPin, HIGH);
 distance = (duration/2) / 29.1;
 Serial.println(" cm");

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


Go Up