Hot answers tagged

4

The documentation on Arduino's website shows SoftwareSerial::read() as returning a char. No it doesn't. There is nothing in the documentation that tells you the return type. There is only an example where the returned value is assigned to a char variable. That doesn't mean that it returns a char - it just means that whatever data type it does return can be ...


3

You'll see in the code just above your third link that the function can return a value of -1 if there is no data present. Thus a 16-bit value is used to cover the range of 8-bit uint8_ts, plus one extra value to show 'no valid data available'. For simplicity, I guess. Yes. This is what it's designed for. In short, for all intents and purposes, only an 8-bit ...


Only top voted, non community-wiki answers of a minimum length are eligible