xapu Posted May 14, 2013 Posted May 14, 2013 (edited) hi! i made the basic native arduino functions in autoit to control it trougth the serial port. it could be interesting for too many people you can find the codes here in my blog there are some more codes using arduino and autoit too xapus.blogspot.com Edited May 14, 2013 by xapu mrflibblehat 1
Nessie Posted May 14, 2013 Posted May 14, 2013 Link is working here: https://code.google.com/p/esto-es-un-proyecto/downloads/detail?name=funciones%20nativas.rar&can=2&q=#makechanges Hi! My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s). My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all! My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file
mrflibblehat Posted May 14, 2013 Posted May 14, 2013 This will come in very useful. Thank you [font="'courier new', courier, monospace;"]Pastebin UDF | Prowl UDF[/font]
wakillon Posted May 15, 2013 Posted May 15, 2013 it return an error message : can't perform this operation on a closed port, port = none, channel number = 1 AutoIt 3.3.18.0 X86 - SciTE 5.5.7 - WIN 11 24H2 X64 - Other Examples Scripts
xapu Posted May 15, 2013 Author Posted May 15, 2013 it return an error message : can't perform this operation on a closed port, port = none, channel number = 1 have you selected the rigth port where your arduino is connected?
mrtweaver Posted September 2, 2015 Posted September 2, 2015 Ok i know this thread is a bit old, 2013 to be exact but am hoping that one can direct me as to what i am doing wrong.I followed the link above, downloaded the file, put the arduino.au3 and comm files in the include folder of autoit.I then went and opened the arduino file in the associated software and loaded it onto the arduino.I opened the first file in autoit, blink, and changed the com port from 3 to 4 since my USB is on 4Ran the file, nothing happenedthe only thing that happened was in the console of autoit i received the number 02Other than that nothing.So what step did i miss?
Surya Posted September 3, 2015 Posted September 3, 2015 Try this code (I Use this to communicate with arduino):unplug all the coms connected to your computer only arduino to itUpload the sketch to arduino run the Arrduino Serial.au3 and click Connectif it says connected then type in "motor on" in the first edit box then click send connect a motor to 8th pin of arduino if its rotating voilla!! you have succeded in connecting your board to autoit Serial communication.zip No matter whatever the challenge maybe control on the outcome its on you its always have been. MY UDF: Transpond UDF (Sent vriables to Programs) , Utter UDF (Speech Recognition)
AndyG Posted September 3, 2015 Posted September 3, 2015 (edited) Hi,Surya, i (and i think mrtweaver too) have no problems to interact with the Arduino-sketch (the sketch! ) via serial connection.There is a difference to send and read "serial" bytes between Arduino-sketch and AutoIt and the possibility to read or write digital or analog in/out-Pins from the Arduino via digitalread()/digitalsend()/analogread()/analogsend()-AutoIt-Functions.I tried to load an "empty" Sketch into Arduino to force it to "do nothing". After that i connected AutoIt (like the communication-Scetch) to Arduino and tried a digitalwrite(10,1) to light the LED (i use this LED mostly for debugging^^ )//EDIT The LED did not light up!How can i read/write analog/digital pin-states from Arduino with AutoIt "directly"? For sure i could write a sketch which reads the state of an Arduino-port and send this as a string "Hi this is Arduino, Digital Port 4 is ON" to AutoIt. That´s not the problem! I would like to use the AutoIt-function digitalread(4) to receive "ON" Edited September 3, 2015 by AndyG
Surya Posted September 3, 2015 Posted September 3, 2015 Hi andyg i understood you, i have tried out the digitalwrite function provided in arduino. Au3 it dont work for me i think that you should use arduino. Exe's command line parameter to upload an arduino scheme written in autoit i don't think arduino board accepts single command execution (i am not sure) No matter whatever the challenge maybe control on the outcome its on you its always have been. MY UDF: Transpond UDF (Sent vriables to Programs) , Utter UDF (Speech Recognition)
Surya Posted September 4, 2015 Posted September 4, 2015 (edited) i think this will do the task: (CODE UNTESTED)#include <File.au3> Func digitalWrite($pin, $com = "COM36",$mode = "LOW",$inst = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Arduino","Install_Dir") &"\arduino.exe" );$mode can only be LOW / HIGH $file = _TempFile(@TempDir, "~", ".ino") FileWrite($file,_SourceCode(9,"digitalWrite")) $run = $inst &" --upload --board arduino:avr:pro --port " &$com &" --verbose-upload " &$file $exit = RunWait($run,"",@SW_HIDE) Return $exit EndFunc ;==>DigitalWrite Func _SourceCode($pin,$do,$state = "HIGH",$out = "OUTPUT") $src = "void setup() {" & _ @CRLF &"pinMode(" &$pin &", " &$out &");" & _ @CRLF &"}" &@CRLF & _ @CRLF &"void loop() {" & _ @CRLF &$do &"(" &$pin &"," &$state &")" & _ @CRLF &"}" Return $src EndFunc ;==>_SourceCode Edited September 4, 2015 by Surya No matter whatever the challenge maybe control on the outcome its on you its always have been. MY UDF: Transpond UDF (Sent vriables to Programs) , Utter UDF (Speech Recognition)
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