fdivitto / sbus Goto Github PK
View Code? Open in Web Editor NEWArduino library for SBUS (Futaba)
License: GNU Lesser General Public License v2.1
Arduino library for SBUS (Futaba)
License: GNU Lesser General Public License v2.1
i tried compile source but error on att85. i have not skill debug code. Please help me a version SBUS decoder to pwm on attiny85 ?
thanks
i have tried the following example
#include <sbus.h>
// used pins
#define SBUS_PIN 13 // D3
SBUS sbus;
void setup() {
Serial.begin(115200);
sbus.begin(SBUS_PIN, sbusBlocking);
}
void loop() {
if (!sbus.waitFrame()) {
Serial.println("Timeout!");
} else {
Serial.println(sbus.getChannel(3));
}
if (sbus.signalLossActive())
Serial.print("SIGNAL_LOSS ");
if (sbus.failsafeActive())
Serial.print("FAILSAFE");
}
and the values i get back looks like this, why i have such big fluctuations, i have done nothing on the sender, can you help me.
1500
1500
1500
1500
1500
1500
1500
1500
1500
1500
1500
917
1500
1500
1500
1500
1500
1500
1500
1500
917
1500
1500
1500
1500
1500
957
thanks for your watching
recently I use this library. I find that the time of read a sbus frame is not stable. sometimes it cost 40ms.I use nonblocking model.the waitFrame function cost too much time and unstable.
how could I promete the reading speed and at the same time make the sbus frame more stable?
timer_1 = micros();
if (!sbus.waitFrame())
{
Serial.println("time out! ");
}
else
{
getChannelSignal();
processSignal(receiver_input_channel[4], n);
n++;
if (n > (USED_NUM - 1))n -= USED_NUM;
//printChannelSignal();
checkSBUS();
generate_pwm();
}
timer_2 = micros();
Serial.println(timer_2 - timer_1);
the output
19744
19756
19752
19756
42664
34736
19756
35492
55616
19752
19748
19756
23476
/Arduino/libraries/sbus/sbus.cpp:259:16: error: invalid conversion from 'volatile uint8_t* {aka volatile unsigned char*}' to 'uint8_t* {aka unsigned char*}' [-fpermissive]
s_pin = pinOfPin(pin);
^
exit status 1
Arduino IDE 1.8.5
Can I use this library on Teensy?
it seems that i cant compile for Leonardo/Micro based on 32u4.
i get errors:
C:\...\libraries\sbus-master\sbus.cpp:104:5: error: 'TCNT2' was not declared in this scope
TCNT2 = 0;
^
C:\...\libraries\sbus-master\sbus.cpp:112:5: error: 'TIFR2' was not declared in this scope
TIFR2 |= 1 << OCF2A;
^
C:\...\libraries\sbus-master\sbus.cpp:112:19: error: 'OCF2A' was not declared in this scope
TIFR2 |= 1 << OCF2A;
^
After some research it seems that there is no timer 2 on the 32u4.
Is it possible to move this to another timer?
If so which pins would we need to be used?
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.