 |
 |
 |
 |
| Name |
|
begin() |
 |
|
|
| Examples |
|
#include <SoftwareSerial.h>
int val;
SoftwareSerial port = SoftwareSerial(8, 9);
void setup() {
pinMode(8, INPUT); // rx pin
pinMode(9, OUTPUT); // tx pin
port.begin(9600); // Start serial Serial at 9600 baud
}
void loop() {
val = port.read(); // read a value and echo it
port.print(val);
}
|
|
|
| Description |
|
The Wiring SoftwareSerial library allows for easily reading and writing data to external machines through software serial ports. The serial port is a nine pin I/O port that exists on most PCs and can be emulated through USB on Macintosh with the Keyspan USB Serial Adaptor. The begin(rate) method must be placed in the setup() method. |
 |
|
|
| Syntax |
|
serial.begin(rate)
|
 |
|
|
| Parameters |
|
| rate |
|
Integer specifying the speed: 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600 or 115200
|
| serial |
|
The software serial port variable
|
|
 |
|
|
| Returns |
|
None |
 |
|
|
| Usage |
|
Application |
 |
|
|
|