View Single Post
  #3   Spotlight this post!  
Unread 08-02-2013, 13:58
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Re: Encoder data recording

I've been looking, but I'm not sure how what I've found helps me. I would like to use a text file to make something like a lookup table. Here's what I have for logic so far:
Code:
/*hopefully all of this data can be collected 
and stored in a text file elsewhere during one 
of the autonomous modes (collect)*/

int arrayLength = 7; 

/*probbly 150-1500 depending on if the data 
samples are in tenths or hundredths of a second.  
Tenths here, and assuming that the autonomous 
period is only 15 seconds*/

float leftside [] = {1,0.9,0.7,0.9,1,0.3,0.9}; //etc...etc..
float rightside [] = {1,1,0.8,1,1,0.4,1};      //etc...etc...
for (int i = arrayLength; i > 0; i--)
{
	Leftmotor->Set(leftside[i])
	Rightmotor->Set(rightside[i])
	Wait(0.1); 

	/*Wait the same interval of time as the data 
        collected.  0.1 for tenths, 0.01 for hundredths, 
        etc...*/
}
/*Implimentation: Record encoder data during practice 
rounds in special dedicated autonomous to a text file.  
Then play back the data in another autonomous mode 
(case 2).  This may not all be syntactically correct*/
(I'm not entirely sure what the encoder sample rate/second is)

Last edited by ekapalka : 08-02-2013 at 14:01.
Reply With Quote