Go Down

Topic: Serial.write(0x00) issue. Solved. Doc change suggestion. (Read 3 times) previous topic - next topic

acolyte

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: [Select]
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: [Select]
Serial.write((byte)0x00);

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

retrolefty


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: [Select]
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: [Select]
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


Osgeld

I just ran into this today, so its still not fixed on 1.0.1
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

Go Up