Shop OBEX P1 Docs P2 Docs Learn Events
STAMP Project Questions — Parallax Forums

STAMP Project Questions

ArchiverArchiver Posts: 46,084
edited 2002-03-01 16:38 in General Discussion
Wonder if any STAMPers out there can help me get
started on a new STAMP II project.
I have keyboard generating ASCII characters fed into a
STAMP II. I want to be able to first send a letter A
thru K then a number 1 thru 12 to the stamp and be
able to control different subroutines with the
different combinations of (letters/numbers). I am not
sure of the most efficient way to get started with
this project?? Got any ideas?
thanks
Tom

__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-03-01 12:32
    The LOOKDOWN command is perfect for converting characters or noncontiguous
    values to a sequential series that can be used with BRANCH to call desired
    code sections. There's a good discussion in the Parallax manual. You can
    download it from our web site: www.parallaxinc.com.

    -- Jon Williams
    -- Parallax


    In a message dated 3/1/02 6:10:01 AM Central Standard Time, techmon@y...
    writes:


    > Wonder if any STAMPers out there can help me get
    > started on a new STAMP II project.
    > I have keyboard generating ASCII characters fed into a
    > STAMP II. I want to be able to first send a letter A
    > thru K then a number 1 thru 12 to the stamp and be
    > able to control different subroutines with the
    > different combinations of (letters/numbers). I am not
    > sure of the most efficient way to get started with
    > this project?? Got any ideas?
    >




    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2002-03-01 16:38
    >Wonder if any STAMPers out there can help me get
    >started on a new STAMP II project.
    >I have keyboard generating ASCII characters fed into a
    >STAMP II. I want to be able to first send a letter A
    >thru K then a number 1 thru 12 to the stamp and be
    >able to control different subroutines with the
    >different combinations of (letters/numbers). I am not
    >sure of the most efficient way to get started with
    >this project?? Got any ideas?
    >thanks
    >Tom

    That is 11*12=132 possible subroutines, if they are all implemented.
    Here is a way to do it if you limit the numbers to 0 to 9, because
    that is a little easier:


    letterin:
    serin pin,baud,[noparse][[/noparse]letter] ' expect ascii 65,..,75
    branch letter-65,[noparse][[/noparse]LA,LB,LC,...,LK] ' letter-65 is 0,1,2,..,10
    goto letterin ' bad letter

    getnumber: ' subroutine
    serin pin,baud,[noparse][[/noparse]number]
    return


    LA:
    gosub getnumber ' expect ascii 48,50,..,57
    branch number-48 ,[noparse][[/noparse]AN0,AN1...,AN9] ' A subroutine to execute 0,1,..,9
    goto letterin ' bad number

    LB:
    gosub getnumber ' expect ascii 48,50,..,57
    branch number-48 ,[noparse][[/noparse]BN0,BN1...,BN9] ' B subroutine to execute
    goto letterin ' bad number

    ' and so on L:,..,LK
    ' then the actual business routines...

    AN0:
    ' routine for "A0"
    go to letterin

    ' and so on

    You probably also need a timeout on the serin commands, in case the
    input gets fried or out of sync. See the manual.

    -- regards,
    Tracy Allen
    electronically monitored ecosystems
    mailto:tracy@e...
    http://www.emesystems.com
Sign In or Register to comment.