Coder Social home page Coder Social logo

futabasbus_samd21's Introduction

SparkFun SAMD21 Firmware for Futaba SBUS

References According to Pete Video: https://www.sparkfun.com/news/2385

This example code is written in Arduino 1.8.2 for a SAMD21 Mini Breakout: https://www.sparkfun.com/products/13664

...to interpret the Futaba SBUS 16-channel data stream. This data stream is a UART signal running at 100K baud, 8E2, AND it's inverted. Yes, really. So before you use this code, you need to invert the signal.

Included in this directory is a pic from my notebook denoting the structure of the bit/channel order. Essentially, the data frame is 25 bytes long, with 0x0F being the first you'll receive and 0x00 being the last. The data frame is preceded by at least 4mS of quiet time on the UART line. Each channle is represented by 11 bits, with those bits split between the bytes. The bit pattern is such that the first 8 bits of channel 1 come first, but instead of 0-1-2-3-4-5-6-7, they come as 7-6-5-4-3-2-1-0. The byte after that contains the last 3 bits of channel one plus the fist 5 bits of channel 2, but again the order is reversed, so you'll first get 4-3-2-1-0 of channel 2, followed by 10-9-8 of channel 1. The rest of the frame follows the same patern, down to the 23rd byte (RX[22] in the code). I don't know what the 24th byte is used for, but the 25th comes as 0x00. If none of that makes sense, try to reference it against the included pic and the code. Good luck!

BTW, if you want to run the LEDs as I've set up, you'll need to install FastLED.

futabasbus_samd21's People

Contributors

pete-o avatar

Stargazers

 avatar  avatar

Watchers

 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

Forkers

hanzc989

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.