title: Arduino Serial write
body: <p>I am trying to use the arduinon Serial.write(buf, leng). here is my code</p>
  
  <pre><code>byte buf[] = {125, 126, 127, 128, 129};
  
  void setup() {
    // initialize serial:
    Serial.begin(9600);
  
  }
  
  void loop() {
    int i = Serial.write(buf, sizeof(buf));
    Serial.println(i);
    delay(1000);
  }
  </code></pre>
  
  <p>However, when I open up the serial monitor this is what it prints out</p>
  
  <pre><code>}~   5
  }~   5
  }~   5
  }~   5
  </code></pre>
  
  <p>First off, I read that write writes binary data to the serial port and that print is the ascii characters. How come I see ascii characters?</p>
  
  <p>The second question is how come nothing over 127 appears?</p>
  
  <p>Whenever I Serial.write(>127) it always shows in the serial monitor a goofy output?</p>
  
  <p>Is it because of the computer's side of serial? </p>
  
  <p>My main goal is to write 32 bytes to serial all at once so they are all in the same payload of my xbee transmitting package. ??</p>