|
本帖最后由 t20109020 于 2018-6-7 14:30 编辑
最近用有刷f3飞控改了架玩具四轴,手上只有个天6控,无奈飞控不支持,结果就用蓝牙模块+手机diy了一个手机遥控。发现在百度上找到的dsm2协议完全不对。几经周折才在国外网站上找到,这里分享出来,给有需要的人,少走点弯路。
The required serial payload is 16 bytes RS-232 at 115200 baud, 8 bit, no parity, atleast 1 stop bit, LSB first. It is expected every 22ms but timing is not critical.
Byte 1 Checksum (sum of bytes 2-16 cast to 1 byte)
Byte 2 Not used (can be any value)
Bytes 3-16 2 bytes per channel with following structure 0b000 CCC 9876543210
- 000 = not used (normally zeros)
- CCC = channel number (0=Thr, 1=Ail, 2=Ele, 3=Rud, 4=Gear, 5=Aux1, 6=Aux2)
- 9876543210 = 10bit channel position
Byte1 Checksum 的计算方法
sum=0;
sum=byte2+byte3+byte4+......+byte16;
if(sum > 0xFF) {
sum=~sum;
sum+=1;
}
sum = sum&0xFF;
文档地址:http://www.micronradiocontrol.co.uk/docs/dt/dt-tx1-k1-1.pdf
|
欢迎继续阅读楼主其他信息
|