Sort of a newbie here. Just started trying to use FreeBasic and am having difficulties. I am running a W7 Pro platform with my laptop connected to an Arduino UNO. The W7 control panel (system>device manager>ports& lpt with my device as Arduino Uno (COM4) so I know the driver is hooked up ok. I also communicated with it using Realterm so I know thi virtual serial port is working. I wrote a very simple program:
var comrtn=99
var a=1
comrtn=Open Com("COM4:9600,N,8,1" AS #a)
Print "Open Com return: ",comrtn
I compiled (no errors) and ran it in a command window and got the print-out:
Open Com return: 1
An error code 1 is supposed to be "Illegal function call" Any idea why ?
Thanks--
Opening COMx for USB port
Re: Opening COMx for USB port
The comport handling of FreeBasic expects a high signal on DSR line by default after opening a comport.
You can suppress that by adding DS0 as extendet option.
comrtn=Open Com("COM4:9600,N,8,1,DS0" AS #a)
should do the job.
I recommend to use:
comrtn=Open Com("COM4:9600,N,8,1,CS0,DS0,CD0" AS #a)
Regards
Steini
You can suppress that by adding DS0 as extendet option.
comrtn=Open Com("COM4:9600,N,8,1,DS0" AS #a)
should do the job.
I recommend to use:
comrtn=Open Com("COM4:9600,N,8,1,CS0,DS0,CD0" AS #a)
Regards
Steini