Reference.SoftwareSerialWrite History

Hide minor edits - Show changes to output

May 25, 2012, at 03:55 PM by Tom Igoe -
Changed lines 18-19 from:
SoftwareSerial mySerial(6, 7);
to:
SoftwareSerial mySerial(10, 11);
November 04, 2011, at 02:56 PM by Scott Fitzgerald -
Added lines 1-38:
!!SoftwareSerial: write(data)

!!!!Description

Prints data to the transmit pin of the software serial port as raw bytes. Works the same as the [[Serial.write]]() function.

!!!!Parameters

[[Serial.write]]() for details

!!!!Returns

byte\\
write() will return the number of bytes written, though reading that number is optional

!!!!Example
(:source lang=arduino:)
SoftwareSerial mySerial(6, 7);

void setup()
{
mySerial.begin(9600);
}

void loop()
{
mySerial.write(45); // send a byte with the value 45

int bytesSent = mySerial.write(“hello”); //send the string “hello” and return the length of the string.
}
(:sourceend:)

!!!!See also

* [[SoftwareSerialConstructor | SoftwareSerial]]()
* [[SoftwareSerialBegin | begin]]()
* [[SoftwareSerialRead | read]]()
* [[SoftwareSerialPrint | print]]()

Share