I am trying to use the arduinon Serial.write(buf, leng). here is my 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);
}
However, when I open up the serial monitor this is what it prints out
}~ 5
}~ 5
}~ 5
}~ 5
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?
The second question is how come nothing over 127 appears?
Whenever I Serial.write(>127) it always shows in the serial monitor a goofy output?
Is it because of the computer's side of serial?
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. ??