Skip to content

Arduino SoftwareSerial but with individual inversion on the RX and/or the TX pin

Notifications You must be signed in to change notification settings

timoxd7/InvertibleSoftwareSerial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Invertible Software Serial

This is a 1:1 Copy of the Arduino Software Serial (New Software Serial) but separates the inversion for the tx and rx pins individually

Usage

It is used exactly as the original Software Serial but with a difference in the Constructor:

InvertibleSoftwareSerial(uint8_t receivePin, uint8_t transmitPin, bool inverse_rx = false, bool inverse_tx = false)

So, to use it in your code, for example to invert the RX pin only, do this (with pin 2 for rx and pin 3 for tx):

InvertibleSoftwareSerial softSerial(2, 3, true, false);

Later in the code, it is used like the normal Serial:

// ...

void setup() {
    // ...
    softSerial.begin(9600); // To select baud rate
    // ...
}

// ...

void loop() {
    // ...
    softSerial.println("Test");
    // ...
}

About

Arduino SoftwareSerial but with individual inversion on the RX and/or the TX pin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages