Multiple programs?
Velvet Leopard
Posts: 47
Hewwo, all.· I have been getting a bit better at my stamp programming.· Can you have more than one program on the stamp at one time?· Or just one?· I am just wondering.
Comments
http://www.parallax.com/dl/docs/cols/nv/vol3/col/nv87.pdf
If you're using a stock BS2, and your programs will fit in the EE space, you can use variable aliasing (using different names for the same RAM space) -- though technically one program, the behavior will be as if two programs are available in the same slot.· Just be a little careful, though, when you switch from one program to the other.· You may want o deliberately reinitialize the variables so that information left over from the other program doesn't interfere with the one that is about to run.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
' {$STAMP BS2e, SLOT1.BSE, SLOT2.BSE}
In this case, the program called SLOT1.BSE will be loaded into slot 1, and SLOT2.BSE will be loaded into slot 2. If you're using the latest compiler (suggested) you can find a description and notes of this use of the $STAMP directive in the Compiler Directives section. And yes, it's in the manual too (section 3).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
Here's a thought:
Could I use this multiple program technique to update (overwite) one of the program slots with an update to a remote stamp?
eg a stamp connected by modem, one of the subroutines could write bytes received directly into a slot, byte by byte?
I believe that Scott Edwards did some experimenting with self-changing programs way back when, but as I remember the experiments were somewhat limited in scope and may not apply to what you want to do.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
"self-changing programs"
Sorta like genetic programming.... Only on a really small scale. Would sorta be cool to write a maze solver that uses genetic programming, but I've got too much on my plate at the moment as it is.
"geneitic programming" sounds interesting.
could you recommend a resource for learning more, a book would be fine fine.
rox on
nick B