Pages: [1]   Go Down
Author Topic: Serial.print(13, BYTE); equivalent command in Arduino 1.0  (Read 12784 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 37
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

 Serial.print(13, BYTE);

when i write the following instruction i get a compile error message saying that BYTE is no longer supported
what is the equivalent instruction to use in Arduino 1.0
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 19
Posts: 3114
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The error I get is...

Quote
As of Arduino 1.0, the 'BYTE' keyword is no longer supported.
Please use Serial.write() instead.

so the compiler actually tells you what to use.

Also, reading the release notes http://arduino.cc/en/Main/ReleaseNotes

Quote
* The behavior of Serial.print() on a byte has been changed to align it
  with the other numeric data types. In particular, it will now print
  the digits of its argument as separate ASCII digits (e.g. '1', '2', '3')
  rather than a single byte. The BYTE keyword has been removed. To send a
  single byte of data, use Serial.write() (which is present in Arduino 0022
  as well).
« Last Edit: January 01, 2012, 07:31:34 am by dxw00d » Logged

Dallas, TX USA
Offline Offline
Edison Member
*
Karma: 47
Posts: 2346
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can use
Code:
Serial.write(13);

Or
Code:
Serial.print((char)13);

--- bill
Logged

Pages: [1]   Go Up
Jump to: