' read 10 characters at a time arduino serial buffer cannot take more than 32 characters MsgBox('Ready to write file content to COM') Set objFile = objFSO.OpenTextFile('C:\docs\quotes.txt', ForReading) ' read content of text file line by line Set com = fso.OpenTextFile('COM7:9600,N,8,1', ForWriting) ' Just make sure that the serial monitor is closed (so bytes are not sent by the arduino board).
' If the serial monitor in Arduino IDE is open, you will get an 'access denied' error. The second vbs is for writing data to arduino: I use Serial.print to send my data, should I be using other command? I checked my sketch on serial monitor and the data does get displayed on it. There are no data saved on the file at all. The above script is for reading data from arduino and save it in to a text file, but it doesn't work for me.
Set objFile = objFSO.OpenTextFile('C:\results.txt', ForWriting, True) Set objFSO = CreateObject('Scripting.FileSystemObject') Set com = fso.OpenTextFile('COM6:9600,N,8,1', ForReading) Set fso = CreateObject('Scripting.FileSystemObject') I found this VB script that seems to work well for everyone:Ĭode: Select all | TOGGLE FULL SIZE Const ForReading = 1 I'm trying to have my arduino UNO communicate with my PC, sending data to the PC and store it in a text file, or read a text file from PC and send it to arduino.