Baritonomarchetto Posted January 21, 2019 Share Posted January 21, 2019 (edited) Hi all, I am trying to let my arduino communicate with autoit for a musical project (a hardware interface for software loop stations like Mobius). My goal is to send autoit some data over serial and then have autoit emulate keyboard presses. I am using CommMG library because I could find the easiest codes for that (I am not a coder in real life). Here is a link to the reference topic i got inspired from: This is the autoit code: #include <CommMG.au3> Global $CMPort = 3 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) While 1 receive() Sleep(100) WEnd Func receive() Local $ret = _CommGetLine(@CR, 100, 100) ; Waits for up to 100 for a carriage return response from Arduino. ConsoleWrite($ret & @CRLF) ;Print to Console. EndFunc As soon as i run the script, I get the "Error!", "Can't connect to Arduino on port - 3" message. Arduino is on COM 3 (at least this is what arduino IDE tells me). Here is the arduino code int a=0; void setup(){ Serial.begin(9600); } void loop(){ a++; Serial.print(a); delay(3000); } Any idea about the cause? Why they are not connecting to each other? Thanks!! Edited January 21, 2019 by Baritonomarchetto Link to comment Share on other sites More sharing options...
Baritonomarchetto Posted January 21, 2019 Author Share Posted January 21, 2019 oook, I was missing the .dll that comes with the library (faceplam) . I placed the .dll that comes with the library in my system32 folder and now it works (at least I have not the error message). Link to comment Share on other sites More sharing options...
htolunaa Posted March 4, 2020 Share Posted March 4, 2020 Hi. The issue was solved? I need to send "1" and "0" to the Arduino Link to comment Share on other sites More sharing options...
Brandan34 Posted March 5, 2020 Share Posted March 5, 2020 Another cause that I have done often that causes this error is having the serial monitor in the arduino editor open. argumentum 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now