Shop OBEX P1 Docs P2 Docs Learn Events
SV: [basicstamps] 3000 lines of code? — Parallax Forums

SV: [basicstamps] 3000 lines of code?

ArchiverArchiver Posts: 46,084
edited 2002-05-24 02:48 in General Discussion
Greetings!

Steve wrote:

> The controller is pretty extensive and I'm going to
> need much more than 300-450 lines of code (more like
> 1000 lines). I've been looking online at the Basic
> Stamp manual 2.0 and it has some information on how I
> can load different "slots" with code, but I haven't
> yet figured out how I can call code in (say) slot 1
> from code in slot 0. Any suggestions?!

I'm working on a Car Lock/general control system, based on a BS2p24, and I
too found I had to split the code...

What I do, is that I've set up a variable defined as Word and the first
thing the program in each slot does is to check the variable, branching to
the necessary subroutines as necessary.

I used a Word size variable(First in the list of VAR's) because of the way
the Stamp software assigns variables to the memory.
(Words first, then Byte, before Nibble and finally Bit)
That way I'm certain that it's always in the same place for all programs.

Of course I don't use all the 65535 different values of the Word, only the
LOWBYTE, and have reserved the HIGHBYTE for other status flags.

I've also set aside a separate page to contain seldomly changed data and
textstrings that I sometimes display on the LCD. (The BS2p allows this with
a STORE command to redirect the READ/WRITE commands)

:-)
Trygve
http://home.c2i.net/trygveh/english/

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-05-24 02:48
    Hi Mark!

    --- Trygve Henriksen <trygve.henriksen@v...>
    wrote:
    > Greetings!
    >
    > Steve wrote:
    >
    > > The controller is pretty extensive and I'm going
    > to
    > > need much more than 300-450 lines of code (more
    > like
    > > 1000 lines). I've been looking online at the Basic
    > > Stamp manual 2.0 and it has some information on
    > how I
    > > can load different "slots" with code, but I
    > haven't
    > > yet figured out how I can call code in (say) slot
    > 1
    > > from code in slot 0. Any suggestions?!
    >
    > I'm working on a Car Lock/general control system,
    > based on a BS2p24, and I
    > too found I had to split the code...
    >
    > What I do, is that I've set up a variable defined as
    > Word and the first
    > thing the program in each slot does is to check the
    > variable, branching to
    > the necessary subroutines as necessary.
    >
    > I used a Word size variable(First in the list of
    > VAR's) because of the way
    > the Stamp software assigns variables to the memory.
    > (Words first, then Byte, before Nibble and finally
    > Bit)
    > That way I'm certain that it's always in the same
    > place for all programs.
    >
    > Of course I don't use all the 65535 different values
    > of the Word, only the
    > LOWBYTE, and have reserved the HIGHBYTE for other
    > status flags.
    >
    > I've also set aside a separate page to contain
    > seldomly changed data and
    > textstrings that I sometimes display on the LCD.
    > (The BS2p allows this with
    > a STORE command to redirect the READ/WRITE commands)
    >
    > :-)
    > Trygve
    > http://home.c2i.net/trygveh/english/
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed.
    > Text in the Subject and Body of the message will be
    > ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >


    __________________________________________________
    Do You Yahoo!?
    LAUNCH - Your Yahoo! Music Experience
    http://launch.yahoo.com
Sign In or Register to comment.