how to set output of Arduino to be inputted to VB.net

i want that output of the arduino to be inputted on an Programming language..VB.net to be exact..some say that is just using serial port..what will i code to send that output from arduino to vb.net..is it analog or digital that will be passed to vb.net?..

here is my code already..it will output high when the sensorvalue is less than 41

int sensorPin = A0;    // select the input pin for the potentiometer
int ledPin = 13;      // select the pin for the LED
int sensorValue = 0;       // value output to the PWM (analog out)
void setup() {
  Serial.begin(9600);
}

void loop() {
  int sensorValue = analogRead(A0);
  Serial.println(sensorValue, DEC);
  delay(0);
 if(sensorValue > 41){
    digitalWrite(ledPin, LOW);  
} else {
    digitalWrite(ledPin, HIGH);  
}       
delay();
  
}

Instead of using LED to the output..i want to send it to computer and later be read to VB.net..is it possible?..

http://arduino.cc/playground/Main/InterfacingWithSoftware
Most PC programming languages have a facility to read from/write to the serial port. Some are easier to use than others. C# is about as easy as it gets. Micro$oft even gives away a version of Visual Studio that can be used to develop C# applications.

The Arduino is on the other end of the serial port, using Serial.print(ln)()/write() and Serial.read() to write to and read from its end of the serial port.

PaulS:
Arduino Playground - HomePage
Most PC programming languages have a facility to read from/write to the serial port. Some are easier to use than others. C# is about as easy as it gets. Micro$oft even gives away a version of Visual Studio that can be used to develop C# applications.

The Arduino is on the other end of the serial port, using Serial.print(ln)()/write() and Serial.read() to write to and read from its end of the serial port.

i have an output(from arduino) that i want to communicate with the computer...

these are from 00000-11111 or 0 - 32 in hex data...can i send that to vb.net?..can you site a sample code..

He has given you the answer
the arduino uses the Serial Library not a pin

Serial.print("text");

but you will need to set u pthe serial first with a baud rate, etc first

then in VB/C# or anyother language with access to serial port, you just need to find the correct serial port, and listen on that for input

pangetadrian, I've posted code on one of your other threads.


Rob

This solution is not "invented" by me but a really good way to do it:

Imports System.IO.Ports
Imports System.Threading

Public Class Form1

Dim WithEvents SerialPort As New IO.Ports.SerialPort

Private Sub ConnectSerial()
Try
SerialPort.BaudRate = 9600
SerialPort.PortName = "COM3"
SerialPort.Open()
Catch
SerialPort.Close()
End Try
End Sub

Private Sub SerialPort_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort.DataReceived
Dim str As String = SerialPort.ReadExisting()
Invoke(myD1, str)

End Sub

Delegate Sub myMethodDelegate(ByVal