-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Description
On the documentation for the SoftwareSerial constructor:
https://www.arduino.cc/en/Reference/SoftwareSerialConstructor
SoftwareSerial(rxPin, txPin)
There is no mention of the inverse_logic argument. See the source:
public:
// public methods
SoftwareSerial(uint8_t receivePin, uint8_t transmitPin, bool inverse_logic = false);
This is confusing for people who read code which uses that third argument. It should be mentioned on the page as an optional argument with an explanation along the lines of:
inverse_logic is used to invert the sense of incoming bits (the default is normal logic).
If set, SoftwareSerial treats a LOW (0 volts on the pin, normally) on the Rx pin as a 1-bit (the idle state) and a HIGH (5 volts on the pin, normally) as a 0-bit. It also affects the way that it writes to the Tx pin.
Warning: You should not connect devices which output serial data outside the range that the Arduino can handle, normally 0V to 5V, for a board running at 5V, and 0V to 3.3V for a board running at 3.3V.