Bill Greiman
Well-known member
There appears to be a problem with the return value of Serial.write().
I ran the following program on Teensy 3.6 with Teensyduino version 1.32.
the output is:
On an Uno the output is as expected:
Is this a bug or am I missing something?
Here are some other programs that seem to return zero.
I ran the following program on Teensy 3.6 with Teensyduino version 1.32.
Code:
void setup() {
Serial.begin(9600);
while(!Serial);
size_t n = Serial.write("test\r\n", 6);
Serial.print("n: ");
Serial.println(n);
}
void loop() {}
the output is:
Code:
test
n: 0
On an Uno the output is as expected:
Code:
test
n: 6
Is this a bug or am I missing something?
Here are some other programs that seem to return zero.
Code:
size_t n = Serial.println("test");
size_t n = Serial.printf("test\r\n");