I am assuming that you already have a simple knowledge of the .NET and Arduino (software & hardware) platforms. If not, there are many tutorials on the internet to help get you started. Let's begin by putting the program on the Arduino.
void setup() {
Serial.begin(9600);
}
//Sends the Number 1234 Over the Serial Port Once Every Second
void loop() {
Serial.write(1234)
delay(1000)
Module
Module1
Sub
Main()
Dim
userRespond
fetchedData
writeString
Console.WriteLine(
"Type R to Read Serial Port."
)
userRespond = Console.ReadLine
If
userRespond =
"R"
Or
"r"
Then
port
As
New
System.IO.Ports.SerialPort
port.PortName =
"COM4"
port.Open()
port.BaudRate = 9600
fetchedData = port.ReadByte
Console.WriteLine(fetchedData)
Console.ReadLine()
Else
"Not a Recognized Command."
End