Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/9.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
Processing 如何通过处理发送字节数组_Processing - Fatal编程技术网

Processing 如何通过处理发送字节数组

Processing 如何通过处理发送字节数组,processing,Processing,我是新来的。我在处理过程中制作了一些GUI,我需要通过串口将一些字节发送到另一个MCU以控制LED。我需要发送代码A00C 01 A2 byte on[]={0xA0, 0x0C, 0x01, 0xA2}; port.write(on); //This won't compile 如何做到这一点?您的思路是正确的,只需对数组使用处理语法(而不是Arduino语法): 您的思路是正确的,只需要对数组使用处理语法(而不是Arduino语法): byte[] on = {(byte)0xA0,

我是新来的。我在处理过程中制作了一些GUI,我需要通过串口将一些字节发送到另一个MCU以控制LED。我需要发送代码A00C 01 A2

byte on[]={0xA0, 0x0C, 0x01, 0xA2}; 
port.write(on); 
//This won't compile

如何做到这一点?

您的思路是正确的,只需对数组使用处理语法(而不是Arduino语法):


您的思路是正确的,只需要对数组使用处理语法(而不是Arduino语法):

byte[] on = {(byte)0xA0, (byte)0x0C, (byte)0x01, (byte)0xA2};