Go Down

Topic: Cleaning up serial comms output, to improve codes size and speed (Read 649 times) previous topic - next topic

westfw

Quote
Code: [Select]

Serial.print(DitherOffDur);
Serial.print(",");
Serial.print(DitherOnDur);
Serial.print(",");
Well, you could make it slightly smaller and a bit easier to read with something like:
Code: [Select]
void printwc(long x) {  // print with trailing comma.
  Serial.print(x);
  Serial.write(',');
}
  :
    printwc(DitherOffDur);
    printwc(DitherOnDur);

It won't save very much code, and probably won't affect execution time at all.




JT007

Thanks guys,

very interesting, i'm working through all of your suggestions.

I'm not the fastest at typing so i will get back to you all with feedback when i've had a chance to get through it all.

Cheers Jason

wildbill

If you jack up the baud rate and implement something to address the issue Cattledog identified, that may be enough. No need for other cleverness and pain if those things get you the speed you need.

Go Up