Arduino的声明一个无符号字节数组 [英] Arduino declaring a unsigned byte array

查看:1492
本文介绍了Arduino的声明一个无符号字节数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过参阅这个问题:

我遵循解决方案的一部分( - 4步骤2)解决问题。一切正常,今天校验再次失败(消息没有被验证的服务器)。

I solve the issue by following only part of the solution (steps 2 - 4). Everything worked fine and today the checksum failed again(message not verified by server).

所以我想,我没有申报的无符号字节数组(如步骤1),并导致Arduino的随机挑来使用符号/无符号字节数组。

So I guess that I did not declared the unsigned byte array (as in step 1), and cause Arduino to randomly pick to use signed/unsigned byte array.

不过,声明无符号字节数组像这样

However, declaring unsigned byte array like this

无符号字节MSGpac​​k [187] = {
    0×00};

unsigned byte MSGpack[187] = { 0x00 };

提示错误的Arduino,指出

prompts error in Arduino, stating

错误:'MSGpac​​k没有在这个范围内声明

error: 'MSGpack' was not declared in this scope

在功能无效injectByte(浮动,INT)

In function 'void injectByte(float, int)':

错误:'MSGpac​​k没有在这个范围内声明

error: 'MSGpack' was not declared in this scope

我应该如何申报的Arduino一个无符号字节数组?谢谢!

How should I declare a unsigned byte array in Arduino? Thanks!

推荐答案

尝试 uint8_t有

uint8_t MSGpack[187] = {0};

这篇关于Arduino的声明一个无符号字节数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆