Pages: [1]   Go Down
Author Topic: Serial.write(0x00) issue. Solved. Doc change suggestion.  (Read 3194 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I was quite perplexed when I tried to send a null byte (0x00) over the Serial interface. After reading http://arduino.cc/en/Serial/Write  I tried
Code:
Serial.write(0x00);

and got this error returned..
call of overloaded 'write(int)' is ambiguous

It turns out that I had to do this...
Code:
Serial.write((byte)0x00);


This is something that might be nice to add to the reference docs.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I was quite perplexed when I tried to send a null byte (0x00) over the Serial interface. After reading http://arduino.cc/en/Serial/Write  I tried
Code:
Serial.write(0x00);

and got this error returned..
call of overloaded 'write(int)' is ambiguous

It turns out that I had to do this...
Code:
Serial.write((byte)0x00);


This is something that might be nice to add to the reference docs.

That problem and that solution has been posted before. It showed up with Arduino IDE release 1.0. I'm pretty sure they have a fix that will be released in the next IDE release in a month or so that casting fix should not be needed there after.

Lefty

Logged

SE USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I just ran into this today, so its still not fixed on 1.0.1
Logged


Pages: [1]   Go Up
Jump to: