I've been struggling with an issue for a while now, where the non-inverted SBUS output from my ESP32-C3 XIAO is a solid HIGH, as indicated by a multimeter and by digitalread(). I'm attempting to transmit 16 channels of SBUS data to a flight controller, and I can confirm that the channels are valid and the formatting is good. The non-inverted HIGH output is going through a hardware inverter thus outputting a LOW, which is also functional and multimeter-tested. Here is my code (well, at least a shortened version of it):
#include "sbus.h"
#define SBUS_TX_PIN 5 // sbus pin for communicating with the fc
HardwareSerial SerialSbus(1); // UART1
// Non-inverted sbus
bfs::SbusTx sbus_tx(&SerialSbus, SBUS_RX_PIN, 4, false);
void setup() {
Serial.begin(115200);
SerialSbus.begin(100000, SERIAL_8E2, 4, SBUS_TX_PIN, false);
// SBUS init
sbus_tx.Begin();
}
void loop() {
uint16_t testChannels[16] = {992,992,992,992,992,992,992,992,992,992,992,992,992,992,0,992}; // testing to see if it outputs correctly
bfs::SbusData test_data;
memcpy(&test_data, testChannels, sizeof(testChannels));
// Send sbus packet every 20ms
sbus_tx.data(test_data);
// Debug: Print SBUS data before transmission
Serial.print("Data Channels: ");
for (int i = 0; i < 16; i++) {
Serial.print(test_data.ch[i]);
Serial.print(" ");
}
Serial.print("digital read: ");
Serial.println(digitalRead(SBUS_TX_PIN)); // This is consistently outputting 1, and the multimeter confirms this. Also no SBUS signal seen by my flight controller.
sbus_tx.Write();
delay(20);
}
What could be the issue? Thanks! Apologies in advance if I neglected to include any vital information.
Hello!
I've been struggling with an issue for a while now, where the non-inverted SBUS output from my ESP32-C3 XIAO is a solid HIGH, as indicated by a multimeter and by digitalread(). I'm attempting to transmit 16 channels of SBUS data to a flight controller, and I can confirm that the channels are valid and the formatting is good. The non-inverted HIGH output is going through a hardware inverter thus outputting a LOW, which is also functional and multimeter-tested. Here is my code (well, at least a shortened version of it):
What could be the issue? Thanks! Apologies in advance if I neglected to include any vital information.