Reference for Wiring version 1.0 Build 0100+ If you have a previous version, use the reference included with your software. If see any errors or have any comments, let us know.
Class | Serial |
||||
---|---|---|---|---|---|
Name | begin() |
||||
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); } int val; void setup() { Serial1.begin(115200); // Start serial Serial1 at 115200 baud } void loop() { if ( Serial1.available() > 0 ) // if data is available to read { val = Serial1.read(); // read it and store it in 'val' } analogWrite(0, val); } |
||||
Description | The Wiring serial library allows for easily reading and writing data to external machines. The serial port used to be a nine pin I/O port that existed on most PCs and can be emulated through a USB serial adapter. The begin(rate) method must be placed in the setup() method. | ||||
Syntax | serial.begin(rate)
|
||||
Parameters |
|
||||
Returns | None | ||||
Usage | Application |