jung6717 / arduino

Automatically exported from code.google.com/p/arduino
0 stars 0 forks source link

Modify the behavior of print() on bytes (unsigned chars). #284

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'm starting to feel that Serial.print(byte) should print the ASCII characters 
corresponding to the digits of the byte (e.g. 123 would be three bytes: '1', 
'2', '3') since Serial.write(byte) sends the single byte.  We then might want 
to get rid of the BYTE constant option for the base parameters.

Original issue reported on code.google.com by dmel...@gmail.com on 5 Jul 2010 at 6:16

GoogleCodeExporter commented 8 years ago
Sounds good to me.

int x = 65;

Serial.print(x); // -> "65" i.e. two characters sent over serial port.
Serial.write(x); // -> "A" i.e. single ASCII "A" = 65 - byte is sent raw over 
serial port.

Confusion?  Not certain.  But if documented well, all should be fine.

Original comment by rogue.bh...@gmail.com on 9 Jul 2010 at 2:16

GoogleCodeExporter commented 8 years ago

Original comment by dmel...@gmail.com on 7 Jan 2011 at 4:08

GoogleCodeExporter commented 8 years ago

Original comment by dmel...@gmail.com on 8 Jan 2011 at 7:13

GoogleCodeExporter commented 8 years ago
https://github.com/arduino/Arduino/commit/97abbd7a31bda59639a653851a01b6b1d77a2d
46

Examples updated here: 
https://github.com/arduino/Arduino/commit/3eae87adc9fbfdd335499b3e74cac12dd347a7
1b

Original comment by dmel...@gmail.com on 26 Feb 2011 at 6:59