View Single Post
  #6   Spotlight this post!  
Unread 10-02-2003, 22:19
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
There's a few little tricks to stay within 26-bytes. Here's a quick list:

1. Use the smallest size possible. Words give 0-65535, Bytes are 0-255, Nibs are 0-15, and bits are 0-1.
2. Reuse variables whenever possible. For example, you said you needed two counter loops--one during auto mode, the other regular. Is there any reason why you can't use the same variable for both?
3. Strip down your SERIN. Only import the stuff you actually use, making sure to update the constants accordingly. For example, the default code imports the X and Y axis for all the joysticks. If you don't use them, get rid of them. Also, just removing them from SERIN doesn't undeclare them. You need to find that section of the code.
4. As a last resort, use scratchpad. It can get to be very messy, very fast but it can also save you a lot of variable space if done correctly.


To answer a few of your specific questions:
Make sure delta_t is in the SERIN statement in the proper place
You cannot ever "undeclare" a variable. VAR, CON, and DATA are all compile-time directives that can be placed ANYWHERE in your source code and have the same effect.
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php

Last edited by rbayer : 10-02-2003 at 22:21.