zendes / sbus Goto Github PK
View Code? Open in Web Editor NEWArduino library for the Futaba SBUS protocol
License: GNU General Public License v2.0
Arduino library for the Futaba SBUS protocol
License: GNU General Public License v2.0
It seems this library is currently incompatible with the ATmega32u4 from the Arduino Leonardo (built into a DFrobot Romeo in my case). Could this library be made compatible? This SBUS library would be great on this robot controller! Thank you.
Here is my Arduino IDE 1.6.4 error messages:
...\arduino-1.6.4\libraries\SBUS\SBUS.cpp: In member function 'void SBUS::begin(bool)':
...arduino-1.6.4\libraries\SBUS\SBUS.cpp:11:3: error: 'TCCR2A' was not declared in this scope
TCCR2A = 0;
^
...\arduino-1.6.4\libraries\SBUS\SBUS.cpp:12:3: error: 'TCCR2B' was not declared in this scope
TCCR2B = 0;
^
...\arduino-1.6.4\libraries\SBUS\SBUS.cpp:13:3: error: 'TCNT2' was not declared in this scope
TCNT2 = 0;
^
...\arduino-1.6.4\libraries\SBUS\SBUS.cpp:14:3: error: 'OCR2A' was not declared in this scope
OCR2A = 249;
^
...\arduino-1.6.4\libraries\SBUS\SBUS.cpp:15:19: error: 'WGM21' was not declared in this scope
TCCR2A |= (1 << WGM21);
^
...\arduino-1.6.4\libraries\SBUS\SBUS.cpp:16:19: error: 'CS22' was not declared in this scope
TCCR2B |= (1 << CS22);
^
Error compiling.
Servo Motor Shaking Problem.
Is there any way stop servo from shaking?
regards,
Speeduae
I am using this sbus in developing an esp32 based program and I'm not sure if it is capable for the esp32 kit.
Great library! It should be included to PlatformIO so we can install it using the automatic package manager it has. Would you accept a PR for a platformio.json file in the repo?
I don't understand why you can't invert the signal inside Arduino. It makes no sense to use hardware to do that.
Hey- thanks for this awesome library. I am having trouble getting it going on an arduino Mega, using a Futaba TX/RX setup. I have a 2N3904/10k/4.7k TTL inverter. The one thing that is curious is that the sbus.getDecoderErrorFrames() value keeps climbing when the Rx is connected and sbus.getDecoderErrorFrames() stops counting the instant I disconnect the Rx.
So it's definitely seeing the receiver, but for some reason all channels are showing as -100 and 100% of data is being lost.
With Rx Connected:
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74470
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74470
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74477
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74486
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74486
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74498
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74503
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74503
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74518
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74518
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74518
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74533
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74533
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74533
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74545
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74545
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74550
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74557
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74557
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74567
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74570
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74570
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74585
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74585
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74585
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74599
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74599
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74599
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74613
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74613
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74616
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74627
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74627
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74634
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74640
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74640
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 74649
With Rx Disconnected:
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 73503
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 73503
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 73503
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 73503
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 73503
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 73503
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 73503
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 73503
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 73503
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 73503
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 73503
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 73503
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 73503
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 73503
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 73503
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 73503
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 73503
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 73503
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 73503
Ch1 -100 Data loss on connection: 100% Frames: 0 / 0 / 73503
When I run a verify I get the error:
`Arduino: 1.8.3 (Mac OS X), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"
/var/folders/yh/gqgw80hd30z342sbsgbybh9w0000gn/T/arduino_modified_sketch_378221/BasicStatus.ino: In function 'void printSBUSStatus()':
BasicStatus:80: error: call of overloaded 'println(long long int)' is ambiguous
Serial.println(millis() - sbus.getLastTime());
^
/var/folders/yh/gqgw80hd30z342sbsgbybh9w0000gn/T/arduino_modified_sketch_378221/BasicStatus.ino:80:47: note: candidates are:
In file included from /Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Stream.h:26:0,
from /Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/HardwareSerial.h:29,
from /Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Arduino.h:232,
from sketch/BasicStatus.ino.cpp:1:
/Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Print.h:77:12: note: size_t Print::println(const __FlashStringHelper*)
size_t println(const __FlashStringHelper );
^
/Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Print.h:77:12: note: no known conversion for argument 1 from 'long long int' to 'const __FlashStringHelper'
/Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Print.h:78:12: note: size_t Print::println(const String&)
size_t println(const String &s);
^
/Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Print.h:78:12: note: no known conversion for argument 1 from 'long long int' to 'const String&'
/Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Print.h:79:12: note: size_t Print::println(const char*)
size_t println(const char[]);
^
/Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Print.h:79:12: note: no known conversion for argument 1 from 'long long int' to 'const char*'
/Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Print.h:80:12: note: size_t Print::println(char)
size_t println(char);
^
/Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Print.h:81:12: note: size_t Print::println(unsigned char, int)
size_t println(unsigned char, int = DEC);
^
/Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Print.h:82:12: note: size_t Print::println(int, int)
size_t println(int, int = DEC);
^
/Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Print.h:83:12: note: size_t Print::println(unsigned int, int)
size_t println(unsigned int, int = DEC);
^
/Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Print.h:84:12: note: size_t Print::println(long int, int)
size_t println(long, int = DEC);
^
/Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Print.h:85:12: note: size_t Print::println(long unsigned int, int)
size_t println(unsigned long, int = DEC);
^
/Users/Rob/Library/Arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino/Print.h:86:12: note: size_t Print::println(double, int)
size_t println(double, int = 2);
^
exit status 1
call of overloaded 'println(long long int)' is ambiguous
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
`
Hi!
I have been using the FUTABA-SBUS library for a long time. Always used parameters 100000, SERIAL_8E2. You have 115200, SERIAL_8N1 (like the default in Arduino). Is it correct? Now I needed a port for the TX 9600,8N1 for the Arduino Nano. Timers T1 and T2 in my program are busy generating 8 PWM.
So question 1. Can I use your library to work without a Serial port but using the timer T0? I do not use delays in my program . In Arduino Nano they are generated on timer 0.
Question 2. Can I use your library to work with the Serial port, turning it off (Serial.end () ), then turn on at 9600 speed, transmit on Tx, then turn it off and on again at 100000 (Serial.began (100000, SERIAL_8E2) )? Thus to organize reception of RX SBUSdata and transfer some others data of Serial TX 9600?
Thank!
Gennady
Hy, it uses fine on Mega, on UNO but seems stucked on NANO V3 (ATmega328p), is it not possible ? I have add Softawre serial to be able to readsome debugs which work on UNO but no possibility to see anything on Arduino Nano. On a program I am making for rc model lighting using SBUS from channel 9, I get running on UNO but not on Nano. Nothing happens.
I am trying since a week now and a good advice if NANO yes or no would be nice.
Otherwise it is a perfect library.
Thanks for reply,
André
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.