Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: SBUS input

  1. #1
    Junior Member
    Join Date
    Sep 2019
    Posts
    4

    SBUS input

    I have been trying on the following code for reading SBUS input from a frsky receiver:
    #include "Wire.h"
    #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() {
    Wire.begin();
    Serial.begin(115200);
    // begin the SBUS communication
    x8r.begin();
    }

    void loop() {
    int i = 1;
    // look for a good SBUS packet from the receiver

    Serial.println("h");
    if(x8r.read(&channels[0], &failSafe, &lostFrame)){
    Serial.println("h234 ");
    // write the SBUS packet to an SBUS compatible servo
    for (i=0; i < 8; i++) {
    Serial.print(i);
    Serial.print(" :");
    Serial.print(channels[i]);
    Serial.print(" "); };
    Serial.println();

    x8r.write(&channels[0]);
    }
    }

    I am using Pin0 (RX1) (and also tried RX5) on Teensy4 as input and the SBUS signal from the receiver passes through an inverter circuit. This code and setup works on an Arduino Mega 2560 board, but not on the teensy4. Please help.

  2. #2
    Junior Member
    Join Date
    Sep 2019
    Posts
    4
    I have tried using 3.3V or 5V, lowering the CPU speed to 24MHz, using #include <I2C_t3.h>. All not working on teensy4.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •