Syntax
int read();
ContentsIndex
PreviousUpNext
UARTClass::read Method
UARTClass Class | Example
Syntax
int read();
Description

reads incoming serial data

Returns

the first byte of incoimng serial data avaiable, -a if no data is available 

Example
int incomingdata = 0;
void setup()
{
    Serial.begin(9600);  
}
void loop()
{
    if (Serial.available() > 0)
    {
        incomingdata = Serial.read();
        Serial.print("received data: ");
        Serial.println(incomingdata, DEC);
    }
}
File

UARTClass.h

Class