PC-PICAXE Programmable Serial Comms - a further option

IanH1960

New Member
Hi,

This might be of interest to existing AHK (Auto Hot Key) users or for any non (or limited) programmers looking to implement programmed serial comms between their PC and PICAXE project. This is to add to the existing serial programming options already desribed in the forum.

For info AHK (http://autohotkey.com) is a fairly easy to learn free scripting language and I've been using it for a while now on my projects. It has good keyboard and mouse scripting features and good general programming capabilities with GUI building features and access to all the normal windows API functions. Scripts can be run directly or compiled to exe's for distribution. It has a huge user base and an active forum.

I've put together a Serial COMMS API in the form of a small library of pre-scripted functions that can be called from users' own scripts to implement serial comms with their PICAXE's.

Details here - http://buggies.builtforfun.co.uk/Sim/BFFCOMMS.php where there is a small download zip package.

The library includes functions for opening and closing the COM port, setting baud rates and timeouts, sending ascii and data bytes, reading bytes without/without qualifiers and with/without timeouts and for read buffer purging.

I've included some sample scripts that are ready to run with accompanying .bas programs. The samples include simple data writes and reads, PC keystroke export to flash LED's, PC joystick driving variable LED brightness and continuous PC monitoring of ADC feedback. The code can be inspected by opening any of the .ahk files in a text editor and it should be fairly clear to see how various settings can be changed or how users could add their own processing code.

I hope this is of use, and if anyone tries the API can you let me know if there are any improvements or additional functions that might be added.

Ian
 

slimplynth

Senior Member
Sounds great Ian, have dabbled with AHK previously so look forward to checking it out. Thanks for sharing.
 
Top