Inverting serial input for Arduino Giga

Hello everyone! I am wondering if anyone knows how to configure one of the Hardware serial ports to invert incoming serial data? This is for use with an SBUS based receiver. Thanks! :slight_smile:

Yes, it is possible to configure a hardware serial port to invert incoming serial data.

Assuming you are using an Arduino board, you can use the Serial library to configure the hardware serial port. The Serial library provides a begin() function that allows you to specify the baud rate and other configuration options for the serial port.

To invert the incoming serial data, you can use the Serial.setRxInverted(true) function. This function sets the serial port to invert the logic level of the incoming serial data.

Here's an example code snippet that demonstrates how to configure a hardware serial port to invert incoming serial data:

void setup() {
  // Initialize the serial port
  Serial.begin(115200);

  // Set the serial port to invert incoming data
  Serial.setRxInverted(true);
}

void loop() {
  // Read incoming serial data
  if (Serial.available() > 0) {
    int data = Serial.read();
    // Process the data
  }
}

im sorry but that isnt true: " 'class arduino::UART' has no member named 'setRxInverted' ", any ideas? (BTW that isnt even in the arduino API, where did you find it?)

setRxInvert exists on ESP32 but not Giga.