bolderflight / sbus

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

Added signed readS function #19

Closed achrn closed 3 years ago

achrn commented 5 years ago

Hi, thanks for the SBUS library.

In my application I wanted to work with integer data, but offset from midpoint of the channel, so not as much processed as readCal() but not as raw as read(). I guess that makes it half-baked.

This can obviously be done outside the library, but it seemed neater inside. I have created readS() (not sure if that's 'read signed' or 'read shifted') that returns signed integer values of offset from defined midpoints, and the associated setMidPoint() and getMidPoint() functions.

There is no writeS() because I have no SBUS-aware hardware to test it with.