Virtual Keyboard (Reads ASCII data from COM port)

Here is a program that reads Serial data, ASCII, and turns that into keyboard strokes. Works with the Serial.print command in the Arduino IDE. (Not sure how it works for Picaxe!)

http://www.aacinstitute.org/Resources/ProductsandServices/AACKeys/AACKeys.html

About halfway down.. kind of hard to see the download link.

All the buttons are wired up one side of the button to the input pin, other side to ground, no pull-up/pull-down required. (The internal pull-up resistors are enables when you use pinMode INPUT and digitalWrite HIGH to the same pin, like we did with the buttons below, only difference is, instead of checking when the pin goes HIGH, you check when it goes LOW (gets grounded out, through the button!:D))

Here's some sample code for the Arduino.

const int buttons[] = { // set up an array for easy access ;)
7, 8, 9, 10};

boolean buttonstate[4]; // boolean = HIGH or LOW (only 2 bits)

void setup(){

Serial.begin(9600); //

for (int x = 0; x < 4; x++){

digitalWrite(buttons[x], HIGH); // first, buttons HIGH

delay(10); // just for kicks and giggles

pinMode(buttons[x], INPUT);

}
}

void loop(){

for (int x = 0; x < 4; x++){

buttonstate[x] = digitalRead(buttons[x]); // Read values of all buttons, store into array

}

if (buttonstate[0] == LOW){ // if button was pushed

Serial.print("A");

}

if (buttonstate[1] == LOW){

Serial.print("B");

}

if (buttonstate[2] == LOW){

Serial.print("C");

}

if (buttonstate[3] == LOW){

Serial.print("D");

}
}
*NOTE: This is UNTESTED code. Just wrote it up while I was writing this!

 

But let me tell you! This product is AWESOME. Simply choose the Baud and COM port you wish to connect to, and at what speed. Upload to your Microcontroller to print serial data, and you can type with your Arduino! (Without having to set it up as a keyboard/HID USB device, just simple! and has limitations)

 

BUT WAIT, there's MORE!

If you use AACKeys, with AutoHotKey (http://autohotkey.com) you can do.. well, anything! (the following is a AutoHotKeyScript) For example:

#n::
::btw::
MsgBox You typed "btw".
return

^M::Run calc.exe

A::
Run "C:\Program Files\Windows Media Player\wmplayer.exe" "C:\Documents and Settings\Owner\My Documents\Downloads\Weeds\Weeds Season 1\Weeds.S01E01.You Can't Miss The Bear.avi"
return

b::
Run "www.google.com"
return

c::
Run "C:\Program Files\Windows Media Player\wmplayer.exe" "C:\your video path\Video_C.avi"
return

d::
Run "C:\Program Files\Windows Media Player\wmplayer.exe" "C:\your video path\Video_D.avi"
return


The # sign is a Windows key press, so pressing Windows key + N opens up a dialog box, or "MsgBox" just says "You typed "BTW""

The ^ sign is a Ctrl (control) key press, so pressing Ctrl + M opens up the Calculator program in Windows.

Using a:: (or A::, not case sensitive) just accounts for the A key. (hassle if you're using keyboard.) This opens up Windows Media Player, and plays an episode of a show called Weeds. (This works for any program, or files, such as text files, folders, programs)

Using b:: (refer above, same ideas) In this situation, opens up your default web-browser, and opens www.google.com, again not very useful if you're typing on your computer, but could be helpful for having your board connect to websites and post data every so often

I'm not aware of anyways to print ASCII values on the Microcontroller that actually count for CTRL, ALT or WINDOWS key.. so using numbers and buttons is the easiest. (keep in mind, for this to work, you need to have AACKeys running and connected) There is some code to count the number of times you push a button, it's in the first part of the Help file, but you'll have to explore that yourself!

I used my 433 MHZ RF kit, and 2 Arduinos, had one across the house, and when I push a button, it would open up a video, or type out whatever I'm sending. (Just experimenting:D)