Jump to content

Send string to Arduino


Recommended Posts

So I'm trying to send a string of data to Arduino using CommMG UDF. It seems that Arduino is not receiving it. I used Device Monitoring Studio and it shows that the data is sent fine and looks exactly the same as if I sent it from Arduino Serial Monitor. Is CommMG compatible with USB?

Global $CMPort = 9
Global $CmBoBaud = 9600
Global $sportSetError = ''
Global $CmboDataBits = 8
Global $CmBoParity = "none"
Global $CmBoStop = 1
Global $setflow = 2

_CommSetPort($CMPort, $sportSetError, $CmBoBaud, $CmboDataBits, $CmBoParity, $CmBoStop, $setflow)

If @error Then
    MsgBox(16,"Error!","Can't connect to Arduino on port - "&$CMPort)
    Exit
EndIf

_CommSetRTS(0)
_CommSetDTR(0)

_CommSendString("x" & 128 & "y" & 256 & "e", 1)

 

Edited by dainiusb
Link to comment
Share on other sites

30 minutes ago, dainiusb said:

Is CommMG compatible with USB?

It should be.  I've used it and seen it used for other "Arduino" serial comm.

Does the _CommListPorts function display the port you are trying to connect to?

Link to comment
Share on other sites

7 minutes ago, spudw2k said:

It should be.  I've used it and seen it used for other "Arduino" serial comm.

Does the _CommListPorts function display the port you are trying to connect to?

Yes. But now it started to work. I don't know what happened.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...