Go Down

Topic: serial.readBytes vs serial.write (Read 1 time) previous topic - next topic

Serial.readBytes expects a char buffer.  Serial.write expects a byte buffer.  And never the twain shall meet without error messages (invalid conversion etc).
Surely they should use the same type, or at least have some (overloading) technique to accept either?

PaulS

Quote
And never the twain shall meet without error messages (invalid conversion etc).

Or a simple cast.

Quote
Surely they should use the same type

Why? They perform different functions. Though, technically, readBytes() should really have been readChars(), but you can't tell the Arduino team much.

Quote
or at least have some (overloading) technique to accept either?

Is a cast too complicated for you?


Quote
or at least have some (overloading) technique to accept either?

Is a cast too complicated for you?


That's an awfully condescending response to a simple request for library standardization.

Go Up