Pages: [1]   Go Down
Author Topic: [HELP] Interfacing HCSR04 to VB.NET  (Read 475 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
#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 .
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nevermind . I get it . Thank You smiley
Logged

Pages: [1]   Go Up
Jump to: