hi Martin! it's grat topic and also great job!
My problem is that i'm trying to communicate with Arduino micro controller which I've programmed to turn on LED if it gets number "1" on Rx or turn it off if it receives number "2".
I did it over hyperterminal panel and it works fine but I would like to do it in AutoIT so I can implement it in my previous project which reads inputs from USB gamepad )) basically I could turn on my light in my room over USB gamepad over serial port
Maybe the problem is that arduino is connected over USB cable but it has USB-RS232 converter on PCB
this is the code that I tried to use, I took it from some user which I thank I've just changed it a little bit
#include <CommMg.au3>
Local $ComError
;~ Dialog to request Com port#, i.e. 1 for Com1
$ComPort = InputBox("Comport#", "Enter Com port number")
$ComBaud = 9600
$ComDataBits = 8
$ComParity = 0
$ComStopBits = 1
$ComFLow = 2
;~ Configure Com port settings
_CommSetPort($ComPort,$ComError,$ComBaud,$ComDataBits,$ComParity,$ComStopBits,0)
MsgBox(0,'Com Set',"Com"&$ComPort&" @"&$ComBaud&" baud "&$ComDataBits&$ComParity&$ComStopBits)
$Bytes = "00000001"
MsgBox(0,'Data to Send',$Bytes)
$Numbytes = BinaryLen(Binary($Bytes))
MsgBox(0,'Data Length',$NumBytes)
$Struct1 = DllStructCreate("byte[" & $Numbytes & "]")
DllStructSetData($Struct1, 1, $Bytes)
MsgBox(0,"DllStruct","Struct Size: " & DllStructGetSize($Struct1) & @CRLF & _
"Struct pointer: " & DllStructGetPtr($Struct1) & @CRLF & _
"Data:" & @CRLF & _
DllStructGetData($Struct1,1))
$ComOut = _CommSendByteArray(DllStructGetPtr($Struct1), $Numbytes, 1)
MsgBox(0,'Data Sent',$ComOut)
can you please help me, just to make it work, it is COM3, and Flow control is None
Many thanks!!