View Single Post
  #8   Spotlight this post!  
Unread 18-02-2003, 11:03
DanL DanL is offline
Crusty Mentor
FRC #0097
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: Somerville, MA
Posts: 682
DanL is just really niceDanL is just really niceDanL is just really niceDanL is just really niceDanL is just really nice
Send a message via AIM to DanL
eh, problem there is you're wasting precious bits. Last year we used up ALL of our memory for our program, and this year we've been VERY conservative with our memory (i.e. if you put your light-relay-on code at the very end of your code, then you can use the two light relay bits as temporary swap bits cause they're just hard-coded later on).

For example...
direction = sw5
If you're setting direction to be equal to sw5, there's no need to make a seperate bit for it. Just make "direction" an alias for "sw5" if you don't want to use sw5 (aliases take no memory).

Same thing with
program1 CON 0
I see no reason for this. Just make the if statement "IF program = 0...."

On PC programming, there's no real problem with memory allocation being as leniant as you're doing it if it's something as small as the robot code is (although it's much more efficient if you use less memory).

However, with something that has as little memory as a PBASIC stamp, you should be really careful with memory allocation - otherwise, you're going to run out.
__________________
Dan L
Team 97 Mentor
Software Engineer, Vecna Technologies