bolderflight / sbus

Arduino and CMake library for communicating with SBUS receivers and servos.
MIT License
387 stars 136 forks source link

Do you have another example ino #1

Closed geekness closed 7 years ago

geekness commented 7 years ago

Hi, Do you have an example ino file that shows how to use this library to read analog pins (pots and switches) and output the sbus stream?

flybrianfly commented 7 years ago

Hi geekness, please see the example I've just added. In this case I'm using 10 Teensy channels (pins 14 - 23) to read 10, 16 bit analog inputs and I'm mapping those values (0-65535) to the SBUS output (172-1811) on 10 of the 16 SBUS channels. I set up an interrupt to control the SBUS timing. I tested this with a Teensy 3.2, a potentiometer on pin 14, and a D25MA servo on SBUS channel 0. Please let me know if you have any issues.

Brian