SBUSのcppとhppだけ(フォーク)
Dependents: optWingforHAPS_Eigen hexaTest_Eigen
Diff: SBUS.hpp
- Revision:
- 1:b2a305158f89
- Parent:
- 0:072c4589bc62
diff -r 072c4589bc62 -r b2a305158f89 SBUS.hpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SBUS.hpp Thu Jan 21 15:30:16 2021 +0000 @@ -0,0 +1,24 @@ +#ifndef _SBUS_ +#define _SBUS_ +#define _SBUS_ + +#include "mbed.h" + +class SBUS +{ +public: + SBUS(PinName tx, PinName rx); + int16_t getData(uint8_t ch); + int getStickVal(int axis); + int getSwitchVal(int parm); + bool failSafe; + +private: + RawSerial sbus_; + void sbusIrqRx (); + int sbusIndex; + unsigned int rcChannel[18]; + long map(long x, long in_min, long in_max, long out_min, long out_max); // From:Arduino.h +}; + +#endif \ No newline at end of file