New Serial.write command in 0016

I have a question about this new command in 0016. What is the benefit of using this command and what does it do that Serial.print won’t do? In other words, why would you use it and what does it do?

I have tried looking up a reference for this but have been unsuccessful so far. Can anyone point me in the direction to trying to understand it?

Thanks in advance.


Here is the page. It’s for BINARY transmission…

Thank you for the link. That tells me what it is now can anyone tell me why you want to use it instead of the Serial.print command? I guess I am asking where it writes the binary data. code example snippet of a use I found is below. I am wondering why use it since I have also written the code with a Serial.print and it works fine sending the output to Processing sketch that graphs the data. Both versions(Serial.write and Serial.print) work well.

*  arWMPGraph.pde                                                                      *
*  Written: 07-01-2009 from code on Arduino Forum                                      *
*  Code reads data from WMP, converts to data form for reading by Processing sketch    *
#include <Wire.h>          // needed to read WM Plus

byte wmData[6];             //six data bytes
int yaw, pitch, roll;     //three axes
int yaw0, pitch0, roll0;  //calibration zeroes
int gyYaw, gyRoll, gyPitch;
int startTag=0xDEAD;

//****************************************  Main Setup  ***********************************
void setup(){
  //Serial.println("     WM+ tester");
  wmpOn();              //turn WM+ on
  calibrateZeroes();    //calibrate zeroes
//***************************************  Main Loop  **************************************
void loop(){
  receiveData();                               //receive data and calculate yaw pitch and roll
  /*Serial.write((unsigned byte*)&startTag, 2);  //see diagram on
  Serial.write((unsigned byte*)&pitch0, 2);    //for info on which axis is which
  Serial.write((unsigned byte*)&yaw0, 2);
  Serial.write((unsigned byte*)&roll0, 2);
  Serial.write((unsigned byte*)&pitch, 2);
  Serial.write((unsigned byte*)&yaw, 2);
  Serial.write((unsigned byte*)&roll, 2);
//************************************  Function Calls  *************************************

AFAIK it’s just an implementation detail due to the use of ‘Print’ as a base class. ‘print’ just calls ‘write’ anyway AFAICT.