Hi, sorry if it's a stupid question but I try to send a synchronisation pattern (0x55 0x55 0x00 0x00 0xFF) to one of my board via the SoftwareSerial library (arduino v1.0.3).
I use these lines:
mySerial.write(0x55);
mySerial.write(0x55);
mySerial.write(0x00);
mySerial.write(0x00);
mySerial.write(0x00);
mySerial.write(0xFF);
At the first "mySerial.write(0x00);" I got this error: call of overloaded 'write(int)' is ambiguous
Why is this only a problem for the 0x00 , and not a problem for the 0x55 ?
And wouldn't it be easier to put this sequence into some kind of string or array or even a loop, rather
than waste code space with 5 calls to the same function ?
michinyon:
Why is this only a problem for the 0x00 , and not a problem for the 0x55 ?
And wouldn't it be easier to put this sequence into some kind of string or array or even a loop, rather than waste code space with 5 calls to the same function ?
It's only a "waste" if the amount of Flash available is approaching or has surpassed zero.
It would IMO be cleaner, as well as resolving your problem, to put the byte sequence into a const byte array and make one call to Serial.write() to send the array.