Shop OBEX P1 Docs P2 Docs Learn Events
Using keyboard input for BS2 — Parallax Forums

Using keyboard input for BS2

agentileagentile Posts: 101
edited 2005-10-20 16:34 in BASIC Stamp
Hello,
· I would like to know if there is a way to·interface my BS2 to my computer so that I can have the BS2 read input from the computer's keyboard while a program is running.· Is there a command for reading the computer's keyboard?

thanks,
agentile·

Comments

  • NewzedNewzed Posts: 2,503
    edited 2005-10-19 19:15
    Type

    SEROUT 16, baud, [noparse][[/noparse]"Enter command", cr]
    debugin com·· 'Type an A

    The debug screen will say

    Enter command
    A

    If you want to send a string to the debug screen declare

    serstring var· byte(8)

    Then instead of debugin write:

    SERIN 16. baud, [noparse][[/noparse]serstring\8]

    You willl have to enter 8 characters - no more, no less.

    For more info see the Help file.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester yet?
    http://hometown.aol.com/newzed/index.html

    ·
  • agentileagentile Posts: 101
    edited 2005-10-20 13:56
    Sid,

    · Thank you.· This is excellent.· What I want to do is to use the BS2 as a calculator using the keyboard as an input.· This project is intended to demonstrate·the limitations of non-floating point arithmetic, and also to·underline the importance of·accurately sizing variables.· Anyway, since we are only entering numbers and operators (single characters), it seems that with a little manipulation of the inputs, this project will work out well.· Thanks again.



    agentile

    P.S. Do you know of·any examples of this type of code available in the archives?
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2005-10-20 14:14
    Is there anyway to cost effectively interface it with a PS2 keyboard (stand alone). I know using a USB keyboard would require a USB chipset and hardware programming to interface to it. Just curious if anyone has done this.

    How about interfacing to a SVGA monitor (The closest think I have is the SX video module which is pretty cool in itself) - but I am guesing this would require much more hardware (e.g. video card interfacing that may be too much for a single BS2 chip).
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-10-20 14:26
    You might try this: http://www.awce.com/pak6.htm

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-10-20 14:34
    People have also reported success using the ezKey http://www.multilabs.net/ezKEY.html

    Some people have kicked around the idea of a svga monitor driver, but I haven't seen someone discuss completing the project.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2005-10-20 14:57
    FYI:

    If you can find an old UNIX SUN-workstation keyboard, the output is RS232 (5V levels) 1200 baud.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Donald BartleyDonald Bartley Posts: 19
    edited 2005-10-20 16:34
    Besides the Multilabs ezKEY they also have color video modules www.multilabs.net/Products.html that you could use to make an on-screen calulator.· Even cooler would be to use their ezMOUSE with the ezVID 2.0 which has a floating character to make a pointer.· Then you could just draw the calculator on the screen and the user could move the pointer around on the screen and click on the numbers and operators on-screen.· tongue.gif
Sign In or Register to comment.