Shop OBEX P1 Docs P2 Docs Learn Events
Code for keyboard imput. — Parallax Forums

Code for keyboard imput.

innovatorinnovator Posts: 2
edited 2005-06-10 11:19 in BASIC Stamp
Hello:

· I'm new in this adventure and I would like to know if a comand exists to perform the following: If a debug is used to ask for a number, what command can be used to retrieve information from the keyboard? and to usethat input to perform basic math function? I'm using a BOE·BS2 RevC.
Thanks.· Please reply to h.pagan@ieee.org or here.

Post Edited By Moderator (Chris Savage (Parallax)) : 6/9/2005 7:49:31 PM GMT

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-06-09 20:28
    DEBUGIN will do the trick.· Keep in mind, however, that the keyboard sends characters, you need to use the DEC modifier to filter the input -- in the demo below it accepts the "0" - "9" keys.

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}

    aNum··· VAR···· Byte

    Main:
    · DEBUGIN DEC1 aNum
    · DO WHILE (aNum > 0)
    ··· DEBUG "*"
    ··· aNum = aNum - 1
    · LOOP
    · DEBUG CR
    · GOTO Main

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-06-09 20:30
    Hyperterm can be used on the PC to act as a terminal for the BS2 'DEBUGIN' command.

    Or, in the PBasic IDE, the "New Debug" icon (looks like a chip with a magnifying glass over it) can provide the interface.
  • innovatorinnovator Posts: 2
    edited 2005-06-10 11:19
    Thanks guys.
    As soon as I finish my little project I'll get back to you.
    pd. wow that was a fast answer
Sign In or Register to comment.