|
I did delete all of the Default section as well as a few functions that were not being used. I did keep the printf section, at least for now.
I believe i figured out the problem. I did not realize that floats were not native to the chip archetecture, so, in my one line i did a cast promotion to do : pwm01=pwm02*((float)in1/127.00)
this i guess must have taken up a lot of memory, so instead i made it like this: pwm01=pwm02*in1/127, keeping it entirely integer mathematics. Shoulda thought of this in teh first place!.
I do need to do a lot of if statements for my auto control, because my team plans on using only sensors to direct the bot, instead of some pre set auto control. We feel that this will work best for the Auto at teh end setup.
And another note: which is more efficent in this chipset, the Switch statements, or nested ifs? And how do you do spanned switch cases? I know in Basic you could to Case 127 to 255, is there a similar way to do it in this langauge? And a final note, does using a void function take more processing power than incoded systems? or the same?
ETA 30 seconds later: What can i do to figure out if it takes too much memory? with the pbasic editor i had a memory chart i could pull down to see my % on program and variable memory. Is there a similar way to do this in picc? And what are the hex limits for variable space and program space as reported by IFI loader?
|