I think the OP is trying to illustrate the inconsistency of the "print" method overloading. Specifically, the difference between "print"ing an int versus a uint8_t.
I've already experienced this problem. Here is some more code to clarify the problem:
uint8_t mybyte; // this is UNSIGNED
int myword; // an int is 16bits - explicitly: int16_t (from stdint.h)
myword = 32;
mybyte = myword;
Serial.print(myword); // prints "32" - as expected
Serial.print(mybyte); // prints " " - not exactly intuitive
Herein lies the problem:
What do you do with a byte? Since a byte === unsigned char, do you print it as a series of characters in a readable format representing the number (e.g. "32")? Do you send the direct value of the byte over the serial connection? It's unclear, because the data type is ambiguous.
A more clearly defined Print Base Class would solve this problem.
For example, for consistency, Print::print(uint8_t n) should be:
void Print::print(uint8_t n)
{
print((long) n);
}
and for clarity, a new method should be added:
void Print::printchar(char c)
{
this->write(c);
}
Unfortunately, this will break a LOT of current code, since people have already accepted that Serial.print((uint8_t)32) prints a space.
The OP is saying that instead of assuming that "print"ing a uint8_t means to send a direct value over the serial connection, it should be "print"ed in the same way as a long value. Furthermore, the OP is saying that to print a byte directly, it should be explicit, e.g. print(mybyte, BYTE). I'm not complacent with that format (if anything BYTE should be changed to DIRECT - semantically differentiating the methods). "print" should be consistent - i.e. always printing readable characters or such.
Again, this will break a lot of code.
b