Shop OBEX P1 Docs P2 Docs Learn Events
Keyboard Input? — Parallax Forums

Keyboard Input?

DaphylDaphyl Posts: 17
edited 2007-01-14 23:42 in BASIC Stamp
Is there any way to read input from the computer keyboard (single key press) while the BS2px application is already running?

David

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-01-14 23:42
    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). You can find others with a web search for "serial buffer" or similar terms.
Sign In or Register to comment.