Software Serial
Z-Uno hardware serial allows UART baud rates starting from 9600 bps. Slower baudrates are available with Software Serial library. The following baudrates are supported: 1200, 2400, 4800 or 9600 bps, 1 stop bit, no parity bit.
Like hardware Serial same methods are available for Software Serial. The only difference is that the rate specified in begin().
Software Serial library cab be attached to any pair of Fast Pins.
Only one duplex (Rx & Tx) Software Serial can be used at time or up to 8 with Tx only.
SoftwareSerial swserial(pinTx, pinRx);
pinTx
pin from Fast Pins that is used for transmit (Tx)
pinRx
pin from Fast Pins that is used for receive (Rx). If not specified, only send operations will be possible.
C++ object is defined
#include "SoftwareSerial.h"
SoftwareSerial swserial(11, 12); // duplex mode on pins 11 and 12
SoftwareSerial swserial_sendonly(14); // send only on pin 14
void setup() {
swserial.begin(4800);
swserial_sendonly.begin(1200);
}
void loop() {
swserial.println(millis());
while(swserial.available()){
char c = swserial.read();
swserial_sendonly.write(c);
}
delay(1000);
}