I have started a library for interfacing AutoHotkey with your Arduino.
These examples utilize the AutoHotkey scripting language [ http://autohotkey.com ]
autohotkey.com:
AutoHotkey is a free, open-source utility for Windows. With it, you can:
- Automate almost anything by sending keystrokes and mouse clicks. You can write a mouse or keyboard macro by hand or use the macro recorder.
- Create hotkeys for keyboard, joystick, and mouse. Virtually any key, button, or combination can become a hotkey.
- Expand abbreviations as you type them. For example, typing "btw" can automatically produce "by the way".
- Create custom data-entry forms, user interfaces, and menu bars. See GUI for details.
- Remap keys and buttons on your keyboard, joystick, and mouse.
- Respond to signals from hand-held remote controls via the WinLIRC client script.
- Run existing AutoIt v2 scripts and enhance them with new capabilities.
- Convert any script into an EXE file that can be run on computers that don't have AutoHotkey installed.
Getting started might be easier than you think. Check out the quick-start tutorial.
Here is the AutoHotkey forum thread. http://www.autohotkey.com/forum/viewtopic.php?t=69598&start=0&postdays=0&postorder=asc&highlight=arduino
This is the initial release, so there will be bugs, maybe some things are done weird, etc. I just need some feedback
The first example I'll give is moving a servo with a slider contol in a gui
(GUI picture below)
Moving a servo with a slider control
To use:
- attach a servo on pin 9
1)Extract the archive
2)Upload Servo.pde sketch to arduino
3)Open Arduino-servo.ahk
4)Edit your com port on line 15
5)Save Arduino-servo.ahk
6)drag Arduino-servo.ahk onto AutoHotkey.exe
7)click and drag and move the slider to move the servo
I included the Autohotkey.exe for ease of use, you can get the executeable from the autohotkey.com site if you would rather. (it's in the zip download)
if you are on linux you need to do a couple things
install wine
$ sudo apt-get install wine
create a link from your linux tty device to emulate the com port
(replace ttyACM0 with the name of arduino that shows up in arduino ide)
$ sudo ln -s /dev/ttyACM0 ~/.wine/dosdevices/com2
make the AutoHotkey.exe file executeable
sudo chmod 777 AutoHotkey.exe
run the scripts like so:
wine AutoHotkey.exe CIRC10.ahk
you dont need to modify the .ahk files, they are setup to use COM2
Servo.zip (239 KB)