Serial.Read History

Show minor edits - Show changes to markup

January 30, 2012, at 05:14 PM by Scott Fitzgerald -
Changed line 27 from:

[@

to:
Changed lines 47-48 from:

@]

to:
Changed lines 50-52 from:
to:
November 04, 2011, at 06:00 PM by Scott Fitzgerald -
Changed lines 7-8 from:

Reads incoming serial data.

to:

Reads incoming serial data. read() inherits from the Stream utility class.

Changed lines 53-54 from:
to:
December 05, 2010, at 12:48 AM by David A. Mellis -
Changed lines 52-53 from:
to:
February 01, 2010, at 05:15 PM by David A. Mellis -
Changed lines 10-11 from:

Serial.()

to:

Serial.read()

Changed lines 13-16 from:

Serial1.()
Serial2.()
Serial3.()

to:

Serial1.read()
Serial2.read()
Serial3.read()

February 01, 2010, at 05:14 PM by David A. Mellis -
Changed lines 10-11 from:

Serial.read()

to:

Serial.()

Arduino Mega only:
Serial1.()
Serial2.()
Serial3.()

February 01, 2010, at 05:12 PM by David A. Mellis -
Changed lines 1-2 from:

int Serial.read()

to:

Serial

read()

Added lines 9-11:

Syntax

Serial.read()

Changed lines 18-19 from:

the first byte of incoming serial data available (or -1 if no data is available) int

to:

the first byte of incoming serial data available (or -1 if no data is available) - int

Deleted line 44:
Changed lines 46-49 from:
to:
February 25, 2008, at 05:28 PM by David A. Mellis -
Changed lines 13-14 from:

an int, the first byte of inocming serial data available (or -1 if no data is available).

to:

the first byte of incoming serial data available (or -1 if no data is available) int

December 19, 2006, at 05:24 PM by David A. Mellis -
Added lines 1-2:

int Serial.read()

March 28, 2006, at 11:15 AM by David A. Mellis - Added info about -1 return value when no data available.
Changed lines 11-12 from:

an int, the first byte of inocming serial data available.

to:

an int, the first byte of inocming serial data available (or -1 if no data is available).

March 27, 2006, at 08:57 PM by Tom Igoe -
Changed lines 38-41 from:
to:
March 27, 2006, at 08:24 PM by Tom Igoe -
Added lines 1-42:

Description

Reads incoming serial data.

Parameters

None

Returns

an int, the first byte of inocming serial data available.

Example

int incomingByte = 0;	// for incoming serial data

void setup() {
	Serial.begin(9600);	// opens serial port, sets data rate to 9600 bps
}

void loop() {

	// send data only when you receive data:
	if (Serial.available() > 0) {
		// read the incoming byte:
		incomingByte = Serial.read();

		// say what you got:
		Serial.print("I received: ");
		Serial.println(incomingByte, DEC);
	}
}


See also

Reference Home

Share