您可以在我的 GITHUB 上找到完整的代码库,您可以在其中找到 IRsendDemoHelicopter.ino 和 IRrecvDump.ino 的示例。这些和 IRremote.cpp 应该可以回答您的问题。我已经计划(一段时间)在 Esplora 上实现发射器。
以下是微秒,可在https://github.com/mpflaga/Arduino-IRremote/blob/master/IRremoteInt.h#L192找到
#define SYMA_UPDATE_PERIOD_CH_A 120 // 0
#define SYMA_UPDATE_PERIOD_CH_B 180 // 1
#define SYMA_HDR_MARK 2000
#define SYMA_HDR_SPACE 2000
#define SYMA_BIT_MARK 320
#define SYMA_ONE_SPACE 687
#define SYMA_ZERO_SPACE 300
这是 R3 和 R5 的位模式。我相信R5是生产中最常见的。
union helicopter {
uint32_t dword;
struct
{
uint8_t Throttle : 7; // 0..6 0 - 127
uint8_t Channel : 1; // 7 A=0, B=1
uint8_t Pitch : 7; // 8..14 0(forward) - 63(center) 127(back)
uint8_t Pspacer : 1; // 15 na
uint8_t Yaw : 7; // 16..22 127(left) - 63(center) - 0(right)
} symaR3;
struct
{
uint8_t Trim : 7; // 0..6 127(left) - 63(center) - 0(right)
uint8_t Tspacer : 1; // 7 na
uint8_t Throttle : 7; // 8..14 0 - 127
uint8_t Channel : 1; // 15 A=0, B=1
uint8_t Pitch : 7; // 16..22 0(forward) - 63(center) 127(back)
uint8_t Pspacer : 1; // 23 na
uint8_t Yaw : 7; // 24..30 127(left) - 63(center) - 0(right)
} symaR5;
};
但他们总是有可能推出新模式。