View Full Version : Keyboard Input?
01-15-2007, 07:14 AM
Is there any way to read input from the computer keyboard (single key press) while the BS2px application is already running?
01-15-2007, 07:42 AM
Sort of. Any BS2 Stamp can read from the Stamp Editor debugger window using the DEBUGIN command. If you don't want to use the Stamp Editor, you can use any Terminal program (like HyperTerminal). The problem is that the Stamp can not do anything else while it's waiting for input. That's true of any Stamp program and all Stamp models. If what you want is to interrupt a running Stamp program by typing something on the computer, you'll need some kind of external serial interface.
Maxim makes a serial transmitter/receiver (MAX3110) that can be accessed using SPI protocol (with the SHIFTIN and SHIFTOUT commands of PBasic) and has a built-in RS-232 converter. All it needs is a crystal and a couple of small capacitors for the crystal.
There are also several manufacturers of preprogrammed PIC processors that act as serial buffers. These are easier to use than the Maxim chip and some are specifically designed for use with the Stamp or similar microcontroller. One example is (www.protean-logic.com/tickit/rsb509B_HTML_Cutsheet.htm (http://www.protean-logic.com/tickit/rsb509B_HTML_Cutsheet.htm)). You can find others with a web search for "serial buffer" or similar terms.