View Single Post
  #11   Spotlight this post!  
Unread 21-08-2006, 11:41
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,186
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: Distinguish Serial Data?

Quote:
Originally Posted by Astronouth7303
It's far faster if the RC doesn't have to perform string parsing.

Also, serial data doesn't have to be continuously streaming. If there's no change, you just don't transmit anything.

As for that big block to sort through the PWM selection, you can just use an array. If you look at tx_data_record in ifi_default.h, you'll see that all the PWMs are contiguous. So you can use this:
Code:
char* pwms = &pwm01; // pwm01 => txdata.rc_pwm01
// elsewhere...
pwms[port] = value;
Of course, if that doesn't work like I think it should (ie, the pointers are screwed up), you'll never know it except by strange, erratic, and just puzzling behavior. Use the dashboard during testing; if user byte 2 or user cmd are anything but 0, something's off.
Great point Jamie.

I probably should have worded my post in a different way. I didn't want to get across so much the method (string vs. hex vs. bin vs. whatever), but rather the idea of only updating certain array values when necessary. Now that I've thought about it, this probably isn't the best solution, but this kind of data syncing is what has been beat into my brain lately with some of the ajax stuff I've been doing.

So pretty much 6600gt just needs to decide whether he wants a static or dynamic serial stream. Static will be easier to parse, but may send a whole bunch of non changing data values that are just taking up space and transmission time. But then again, we're talking about data on such a small scale it probably won't make a huge difference in overall processing time. (Transmission + parse + execution)