Giter VIP home page Giter VIP logo

sbus's People

Contributors

aleyrobotics avatar drodin avatar fdivitto avatar per1234 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sbus's Issues

big fluctuations in the received values

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

how to promote the speed

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

Compile error

/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

Timer problems on Leonardo/Micro

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.