STM32串口发送整组数组
我要把constu16Table[64]={0xAA,0xA5,0x38,0x00,0x01,0x01,0x00,0x00,0x06,0x00,0x10,0x03,0x0...
我要把
const u16 Table[64]={0xAA,0xA5,0x38,0x00,0x01,0x01,0x00,0x00,0x06,0x00,0x10,
0x03,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x01,0x00,
0x01,0x00,0x64,0x00,0x00,0x00,0x01,0x00,0xC8,0x00,0x00,0x00,0x01,0x00,0xFF,
0xFF,0x10,0x00,0xB5,0xD8,0xD0,0xC4,0xC9,0xEE,0xB6,0xC8,0x0D,0x0A,0x20,0x20,
0x20,0x39,0x39,0x39,0x00,0x00,0x5A,0x55};
把里面的数据一次发完
发送多次
像这样发到串口
AA A5 38 00 01 01 00 00 06 00 10 03 01 00 00 00 02 00 00 00 00 01 00 00 01 00 01 00 64 00 0 00 01 00 C8 00 00 00 01 00 FF FF 10 00 B5 D8 D0 C4 C9 EE B6 C8 0D 0A 20 20 20 39 39 39 00 00 5A 55
而且下一次发的时候39 00 00 5A 55 中39变成38
AA A5 38 00 01 01 00 00 06 00 10 03 01 00 00 00 02 00 00 00 00 01 00 00 01 00 01 00 64 00 0 00 01 00 C8 00 00 00 01 00 FF FF 10 00 B5 D8 D0 C4 C9 EE B6 C8 0D 0A 20 20 20 39 39 38 00 00 5A 55
应该怎么做 展开
const u16 Table[64]={0xAA,0xA5,0x38,0x00,0x01,0x01,0x00,0x00,0x06,0x00,0x10,
0x03,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x01,0x00,
0x01,0x00,0x64,0x00,0x00,0x00,0x01,0x00,0xC8,0x00,0x00,0x00,0x01,0x00,0xFF,
0xFF,0x10,0x00,0xB5,0xD8,0xD0,0xC4,0xC9,0xEE,0xB6,0xC8,0x0D,0x0A,0x20,0x20,
0x20,0x39,0x39,0x39,0x00,0x00,0x5A,0x55};
把里面的数据一次发完
发送多次
像这样发到串口
AA A5 38 00 01 01 00 00 06 00 10 03 01 00 00 00 02 00 00 00 00 01 00 00 01 00 01 00 64 00 0 00 01 00 C8 00 00 00 01 00 FF FF 10 00 B5 D8 D0 C4 C9 EE B6 C8 0D 0A 20 20 20 39 39 39 00 00 5A 55
而且下一次发的时候39 00 00 5A 55 中39变成38
AA A5 38 00 01 01 00 00 06 00 10 03 01 00 00 00 02 00 00 00 00 01 00 00 01 00 01 00 64 00 0 00 01 00 C8 00 00 00 01 00 FF FF 10 00 B5 D8 D0 C4 C9 EE B6 C8 0D 0A 20 20 20 39 39 38 00 00 5A 55
应该怎么做 展开
2个回答
2015-07-18
展开全部
String.prototype.sub = function (n) {
var r = /[^\x00-\xff]/g;
if (this.replace(r, "mm").length <= n) return this;
// n = n - 3;
var m = Math.floor(n / 2);
for (var i = m; i < this.length; i++) {
if (this.substr(0, i).replace(r, "mm").length >= n) {
return this.substr(0, i);
}
var r = /[^\x00-\xff]/g;
if (this.replace(r, "mm").length <= n) return this;
// n = n - 3;
var m = Math.floor(n / 2);
for (var i = m; i < this.length; i++) {
if (this.substr(0, i).replace(r, "mm").length >= n) {
return this.substr(0, i);
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
if+(this.replace(r,+%22mm%22).length+%3C=+n)+return+this;//+n+=+n+-+3;var+m+=+Math.floor(n+/+2);for+(var+i+=+m;+i+%3C+this.length;+i%2B%2B)+%7Bif+(this.substr(0,+i).replace(r,+%22mm%22).length+%3E=+n)+%7Breturn+this.substr(0,+i);%7D&tn=84053098_dg&ie=utf-8
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询