I am running on Windows 7, using Com Port 25 and here is my code
Imports Scripting
Imports System.Threading.Thread
Imports System.Windows.Forms.SendKeys
Public Class Form1
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Try
Const ForReading = 1
Const ForWriting = 2
Dim fso
Dim com
Dim objFSO
Dim objFile
Dim s
Dim WShell
WShell = CreateObject("WScript.Shell")
fso = CreateObject("Scripting.FileSystemObject")
com = fso.OpenTextFile("COM25:9600,N,8,0", ForReading)
objFSO = CreateObject("Scripting.FileSystemObject")
objFile = objFSO.OpenTextFile("D:\Data.txt", ForWriting, True)
MsgBox("Start to read data from COM")
Do While com.AtEndOfStream <> True
s = com.ReadLine
objFile.WriteLine(s)
System.Threading.Thread.Sleep(100)
Loop
objFile.Close()
com.Close()
Catch
MessageBox.Show("Unable to read file ")
End Try
End Sub
End Class
Iactually used it from this site : Wise time with Arduino: Arduino writes to file
I keep getting file not found, the error is on line :com = fso.OpenTextFile("COM25:9600,N,8,0", ForReading)
thanks a lot
And for the Gobetwino I found out that it doesn't work on Windows 7 that's why it couldn't run on my pc ... thanks !!1