Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/multithreading/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Arrays 如何将数字存储到NFC标签中?_Arrays_Arduino_Nfc - Fatal编程技术网

Arrays 如何将数字存储到NFC标签中?

Arrays 如何将数字存储到NFC标签中?,arrays,arduino,nfc,Arrays,Arduino,Nfc,我是越南人,所以我的英语不好。我有一个RFID传感器。我想将数据存储到NFC标记块中 我的项目是在读取标记时为标记添加一个分数。但是我不能将数据作为int类型插入(添加分数)。但在向块中插入数据时,它会请求字节类型的数组 我不知道如何将int类型转换为数组字节类型。 此项目在Arduino上。使用低字节和高字节函数或使用简单的位移位 int asInt = 1234; byte asByte[2]; asByte[0] = asInt >> 8; asByte[1] = asInt

我是越南人,所以我的英语不好。我有一个RFID传感器。我想将数据存储到NFC标记块中

我的项目是在读取标记时为标记添加一个分数。但是我不能将数据作为int类型插入(添加分数)。但在向块中插入数据时,它会请求字节类型的数组

我不知道如何将int类型转换为数组字节类型。
此项目在Arduino上。

使用低字节和高字节函数或使用简单的位移位

int asInt = 1234;
byte asByte[2];

asByte[0] = asInt >> 8;
asByte[1] = asInt & 0xFF;