Reference for Wiring version 0027+ If you have a previous version, use the reference includede with your software. If see any errors or have any comments, let us know.

Name

Serial

Examples
int val;

void setup() {
  Serial.begin(9600);  // Start serial Serial at 9600 baud
}

void loop() {
  if( Serial.available() > 0 )  // if data is available to read
  {
    val = Serial.read();        // read it and store it in 'val'
  }
  analogWrite(0, val);
}
Description There are two serial ports available on the Wiring board, Serial and Serial1. The port Serial is available through the USB adapter on the Wiring board, and the port Serial1 is available on Wiring I/O pins 2(Rx) and 3(Tx). Typical baudrates are: 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600 and 115200.
Syntax
Serial
Methods
begin()
read()
print()
println()
available()
peek()
end()
Returns None
Usage Application
Updated on February 22, 2011 06:16:16pm PST

Creative Commons License