bolderflight / sbus

Arduino and CMake library for communicating with SBUS receivers and servos.
MIT License
387 stars 136 forks source link

Will this work with an Adafruit Feather M0 and RadioLink R9DS receiver? #21

Closed sheariley closed 3 years ago

sheariley commented 5 years ago

I'm just trying to read the value of the first channel, using the example from the README.

I've double and triple checked my inverter wiring against your example and several others (3.3v). I have the transistor collector pin connected to the Rx/0 pin on the Adafruit Feather M0, along with a 10k pull-up resistor from the Feather's 3.3v pin. Finally, I have the 5v signal from the RadioLink R9DS receiver's SBUS pin connected to the transistor's base pin through a 1k resistor.

I've made sure that the receiver is in SBUS mode; the blue light is on. The transmitter shows that its connected.

RadioLink_Feather_SBUS

It seems like this should work. Is there something different about the Feather's architecture that might be making it fail to read the SBUS signal?

Here is my Arduino code:

#include <SBUS.h>

// a SBUS object, which is on hardware
// serial port 1
SBUS x8r(Serial1);

// channel, fail safe, and lost frames data
uint16_t channels[16];
bool failSafe;
bool lostFrame;

void setup() {
  // begin the SBUS communication
  x8r.begin();
}

void loop() {
  // look for a good SBUS packet from the receiver
  if(x8r.read(&channels[0], &failSafe, &lostFrame)){
    Serial.print("Channel 1: ");
    Serial.println(channels[0]);
  }
}
sheariley commented 5 years ago

I've created a pull request to resolve this: #22