Bit of an old post, BUT.... With the Bolder library and Teensy 4.0 you do NOT need the inverter circuit. After trying a lot with an inverter (using 4049 chip) I found the comment deep in one of the fora (forums?) Cannot remember exactly where just yet. I connected an xmplus via a level shifter (very careful here, because the xmplus likes 5v, but the teeensy doesn't). The sbus wire goes straight to (rpt. via level shifter) the rx pin on Teensy.
This works:-
Code:
#include <elapsedMillis.h>
#include <SBUS.h>
// reads an SBUS packet from an
// SBUS receiver.
#include "SBUS.h"
SBUS xmplus(Serial1);
void setup() {
xmplus.begin();
Serial.begin(9600);
// Joystick.useManualSend(true);
}
void loop() {
float channels[16]; bool failSafe; bool lostFrame;
while(xmplus.readCal(&channels[0], &failSafe, &lostFrame)){
Joystick.Zrotate(int((channels[0] + 1.0) * 512.0)); // ailerons - roll
Joystick.Z(int((channels[1] +1.0) * 512.0)); // Elevator - pitch
Joystick.Y(int((channels[2] +1.0) * 512.0)); // Throttle
Joystick.X(int((channels[3] +1.0) * 512.0)); // Rudder - Yaw
Joystick.sliderLeft(0);
Joystick.sliderRight(0);
delay(5);
}
}
Seems like a waste of the Teensy..... only 1% of memory used !! I tested with FPVFreerider Works ok.
Hmmmm! Found the thread - 'tis an answer to funway ......