Quote:
|
Originally Posted by RbtGal1351
Ok now please bear with me, im a rookie programmer, but why would the above example save any memory space on the actual robot controller? when you build it, it just makes it assembly language (the .hex file), and both those (above) are the same. thats the whole goal.
|
There are only about 1300 bytes (1200? I forget the exact number.) of variable space available to the user. My first example requires three ints, for a total of six bytes. The second example requires two ints, for a total of four bytes. I understand that variable allocation is not the only concern with respect to memory, but teams will discover that if they start wildly instantiating global variables, they'll start getting a lot of weird compiler errors, indicating that they've run out of space.
Quote:
|
Originally Posted by RbtGal1351
look up tables are faster and smaller than calculating something
|
Faster, maybe, but definitely not smaller. I've been seeing all of these lookup tables that teams are using for desensitizing their joysticks, when all they really need is a simple quadratic equation, which I'm certain will take up significantly less space on the bot.
Quote:
|
Originally Posted by Mark McLeod
have you tried using the built-in compiler optimization to reduce your program bulk?
|
Hm... no I haven't. I didn't even know that existed. That may very well come in handy for all of us. Thanks.