View Single Post
  #2   Spotlight this post!  
Unread 15-09-2004, 16:45
colt527 colt527 is offline
Registered User
AKA: Ken Colton
FRC #0527
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Long Island
Posts: 123
colt527 is a splendid one to beholdcolt527 is a splendid one to beholdcolt527 is a splendid one to beholdcolt527 is a splendid one to beholdcolt527 is a splendid one to beholdcolt527 is a splendid one to beholdcolt527 is a splendid one to behold
Send a message via AIM to colt527
Re: Saving a variable in between runs.

Quote:
Originally Posted by pi_guy578
Am I mistaken by saying if you initialize a static variable such as static int inBetween and it will store the varaible into the program, instead of the RAM. That is the ANSI C standard AFAIK, I'm not sure if its different on PIC chips... Can someone clarify?

Jake
Yes this is all well and good if you variable is not going to change in mid run, then use that same value again in the next rounds. This EEPROM is used for people who need to dynamically change variables and use them at a different time.

I'm using it to store p1_x values that a gyro calculated to make it go strait. Then next time I hit forward on the joystick it would start off with the calculated p1_x value instead of default 127. This (hopefully) will eliminate any beggining turning while the gyro is building up error.
__________________
Mentor, Team 527 -- Plainedge Red Dragons
FIRST Volunteer
SUNY Stony Brook Computer Science 2010
kcolton@gmail.com

Last edited by colt527 : 15-09-2004 at 16:49.