View Single Post
  #80   Spotlight this post!  
Unread 13-06-2002, 21:07
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
I'd think so...

If not, here's the code I used. It takes the cross between two consecutive packets, but it really doesn't matter since the refresh rate is much higher than the eye could ever detect.
Code:
int i;
int start;
unsigned char info[26];
for(int i=0; i <=24; i++){
  if(readBuff[i]==255 && readBuff[i+1]==255){  //packets start with 255,255
  start=i;
  break;
  }
}

for(int i=start; i<=25; i++){
  info[i-start]=readBuff[i];
}
for(int i=0; i<start; i++){
  info[i+(26-start)]=readBuff[i];
}
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php