Shop OBEX P1 Docs P2 Docs Learn Events
Trying to create a multi-file project for the BSe2 Stamp — Parallax Forums

Trying to create a multi-file project for the BSe2 Stamp

BobertBobert Posts: 2
edited 2005-12-29 19:33 in BASIC Stamp
I am fairly new to the Stamp, BS2e, ·and am having trouble creating a multi-file project that works. I am able to load the files to the BS2e but have not been able to get the second file (program) to run.

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-12-29 01:38
    This thread is being moved from Forum Support to the BASIC Stamp forum.

    Creating multiple program projects simply involves adding the filenames of the programs for the other slots into the Stamp Directive of the main program (Slot 0).· This is accomplished like the example below.· You then use the RUN command to pass program control to these programs.

    '   {$STAMP BS2pe, KTablePos.BPE, KTableNeg.BPE}
    '   {$PBASIC 2.5}
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-12-29 18:10
    Bobert said...
    Chris,
    Thank you for your prompt answer concerning my not being able to get the multi-file project to work. I believe I have my files set up just like you showed in your example and when I do the "run", both files load and can be seen in the Memory Map, but only the first program (file) actually runs. The programs I am running are using the SHIFTOUT command to turn Christmas lights on/off with 74HC595's. The individual programs work fine, but when combined, I am only able to control the lights with·file #1. The only information I have been able to find on this subject is in the the Basic Stamp Manual version 2.0, and am not real sure what is supposed to take place. I had assumed that program #1 would run and then #2 would automatically start. Is this correct? My hope was that I could put up to 8 of these files together, have them run, one after the other, and then loop back to the first program, so that it would run endlessly until the stamp were shut down. Is this correct? With the 2K EEPROM limit, one program just doesn't hold enough command lines, but if I can combine 8, I will be okay.
    Bobert,

    ·· I think you misunderstood me about the RUN command.· When you "Run" from within the BASIC Stamp Editor it downloads all the files to the BASIC Stamp and then RUNs the first one.· However, if you want to pass program control on to the other programs, your first program has to contain a RUN command that tells the next program to start running.· The RUN command will be followed by the slot number (0-7) of the slot which has the program you want to run next.· In turn, if that program needs to return to the first, or run yet another, it should contain a RUN x command as well.· I hope this clears things up for everyone who has wondered about this.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • BobertBobert Posts: 2
    edited 2005-12-29 19:30
    Thanks for you help.

    The multi-file program is now working great. I think one thing that would have really helped me from the start would have been for the multi-file section in the Basic Stamp Manual to have mentioned the need for the RUN command needing to be inserted into the programs.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-12-29 19:33
    Bobert,

    ·· I'm glad that helped, and thank you for your feedback.· We are always looking for ways to improve on our documentation.· I will do what I can to see that this is addressed in future revisions of the BASIC Stamp Manual.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
Sign In or Register to comment.