Arduino - SoftwareSerialBegin

Arduino

Guide

Tutorials

Reference

Hardware

Software

Forum

Playground

Exhibition

Hacking

FAQ

Buy

Language | Libraries | Comparison

## SoftwareSerial: begin(speed)

#### Description

Sets the speed (baud rate) for the serial communication. Using speeds higher than 9600 baud will result in faulty communication.

#### Parameters

speed: the baud rate (long)

#### Returns

none

#### Example

    // include the SoftwareSerial library so you can use its functions:
    #include <SoftwareSerial.h>

    #define rxPin 2
    #define txPin 3

    // set up a new serial port
    SoftwareSerial mySerial =  SoftwareSerial(rxPin, txPin);

    void setup()  {
      // define pin modes for tx, rx:
      pinMode(rxPin, INPUT);
      pinMode(txPin, OUTPUT);
      // set the data rate for the SoftwareSerial port
      mySerial.begin(9600);
    }

    void loop() {
      // ...
    }

#### See also

- SoftwareSerial()
- read()
- print()
- println()

Reference Home

Corrections, suggestions, and new documentation should be posted to the Forum.

Edit Page | Page History | Printable View | Recent Site Changes