Shop OBEX P1 Docs P2 Docs Learn Events
[mini project] Fully Automatic PST — Parallax Forums

[mini project] Fully Automatic PST

xanaduxanadu Posts: 3,347
edited 2014-04-04 21:54 in General Discussion
My Logitech programmable keyboard broke, and I don't feel like spending $150 on a new one. I never realized how annoying it was to work with the serial terminal without keyboard macros. So I used my second favorite piece of software (other than password safe) to solve the issue, and thought I would share.

This script will fully automate your PST terminal, so you never have to click enable or disable. Linux users, I'm sure you already know how to script such events.

Windows Users:

Step 1. Download and install *AutoHotkey from http://ahkscript.org/download/

Step 2. After installing, create a text document called "autopst.ahk" without the quotes.

Step 3. Copy and paste the code below into that document
~F10::
sleep, 500
Send {F12}
SetControlDelay -1
ControlClick, TButton2,Parallax Serial Terminal - [Disabled. Click Enable button to continue.],,,, NA

Step 4. Save and close your document

Step 5. Execute the .ahk file you just created. You will notice a little green icon in the system tray, right-click it for options such as exit.

Step 6. Open the Propeller Tool and also open the PST (you should always manually open the PST once, more on this later)

Step 7. Normally pressing F10 key will upload your current program to RAM, with the script running it will call the PST to the front, and enable it for you. This way you can see the start of your program without having to click anything :)

NOTE: The line "sleep, 500" can be modified, depending on your computer's speed. You can also increase it so you do not have to manually open the PST once. If you do that, add a small pause to your program, just in case the terminal is not activated before your program begins.

*This software is open source, it is not nagware, spyware, etc, contains no advertisements, and can help you in a lot of ways.

Comments

  • xanaduxanadu Posts: 3,347
    edited 2014-04-04 21:45
    Code breakdown, feel free to modify.

    ~F10:: 'this line starts with ~, that means it will pass the keystroke to the current window, as well as trigger the script. The F10 key is the trigger

    sleep, 500 'this makes sure that the PST will not error out in a bind with your already open serial port when pressing F10 (manually opening the PST once will also help with this)

    Send {F12} ' this line sends the F12 key to open, or bring the PST to the front

    SetControlDelay -1 ' this line improves reliability

    ControlClick, TButton2,Parallax Serial Terminal - [Disabled. Click Enable button to continue.],,,, NA ' this line click the enable button for you



    Hope this saves you some time.
  • xanaduxanadu Posts: 3,347
    edited 2014-04-04 21:54
    I forgot one thing, make sure your PST, Prefs..., Function Tab, Serial Port Selection has both checkmarks for disable and wait 10 seconds checked.
Sign In or Register to comment.