Loading...

Serial.Write History

Hide minor edits - Show changes to markup

January 30, 2012, at 11:11 AM by Scott Fitzgerald -
Changed line 46 from:

(:include SerialSeeAlsoIncludes:)\\

to:

(:include Reference/SerialSeeAlsoIncludes:)\\

January 30, 2012, at 11:10 AM by Scott Fitzgerald -
Changed lines 46-48 from:
to:

(:include SerialSeeAlsoIncludes:)\\

October 31, 2011, at 09:44 AM by Tom Igoe -
Changed line 32 from:

[@

to:

(:source lang=arduino tabwidth=4:)

Changed lines 42-44 from:

@]

to:

(:sourceend:)

October 30, 2011, at 02:10 PM by Scott Fitzgerald -
Added lines 27-44:

Returns

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

Example

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

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

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

February 01, 2010, at 11:25 AM by David A. Mellis -
Changed lines 15-16 from:

Arduino Mega also supports: Serial1, Serial2, Serial3

to:

Arduino Mega also supports: Serial1, Serial2, Serial3 (in place of Serial)

February 01, 2010, at 11:24 AM by David A. Mellis -
Changed lines 15-16 from:

Arduino Mega also supports: Serial1, Serial2, Serial3 instead of Serial.

to:

Arduino Mega also supports: Serial1, Serial2, Serial3

February 01, 2010, at 11:24 AM by David A. Mellis -
Changed lines 1-2 from:

Serial.write()

to:

Serial

write()

February 01, 2010, at 11:23 AM by David A. Mellis -
Changed lines 9-12 from:

serial.write(val)
serial.write(str)
serial.write(buf, len)

to:

Serial.write(val)
Serial.write(str)
Serial.write(buf, len)

Arduino Mega also supports: Serial1, Serial2, Serial3 instead of Serial.

June 05, 2009, at 11:44 AM by David A. Mellis -
Added lines 1-26:

Serial.write()

Description

Writes binary data to the serial port. This data is sent as a byte or series of bytes; to send the characters representing the digits of a number use the print() function instead.

Syntax

serial.write(val)
serial.write(str)
serial.write(buf, len)

Parameters

val: a value to send as a single byte

str: a string to send as a series of bytes

buf: an array to send as a series of bytes

len: the length of the buffer

See also




Bookmark and Share