简体   繁体   English

为什么Arduino Midi Library读取十六进制F7为0

[英]Why Arduino Midi Library reads hexadecimal F7 as 0

I have connected my effect processor midi out to arduino midi in shield and I am trying to read sysex messages coming from my effect processor using the Midi library of arduino everything runs fine but when it comes to hexademical number F7 my arduino read 0. I know F7 is 247 does anyone knows why is this happening? 我已经将我的效果处理器midi屏蔽连接到arduino midi上,并且我正尝试使用arduino的Midi库读取来自我的效果处理器的sysex消息,一切运行正常,但是当涉及到六进制数字F7时,我的arduino读为0。我知道F7是247,有人知道为什么会这样吗?

I use this code 我用这个代码

#include <MIDI.h>

void handle_sysex(byte *a,byte sizeofsysex)
{
 Serial.println(sizeofsysex,DEC);
 for(int n=0;n<sizeofsysex;n++)
{
Serial.print(a[n]);
Serial.print("  ");
}
 Serial.print('\n');
}
void setup() {
Serial.begin(9600);
// Initiate MIDI communications, listen to all channels
MIDI.begin(MIDI_CHANNEL_OMNI);    
MIDI.setHandleSystemExclusive(handle_sysex);
}
void loop() {
// Call MIDI.read the fastest you can for real-time performance.
MIDI.read();
}

This was discussed on github and it looks like it was a bug fixed by either #67 or #66 . 在github上进行了讨论,它看起来像是由#67#66修复的错误。 The args for handler function changed too, second arg is now unsigned size to allow for size beyond 255. 处理函数的args也改变了,第二个args现在是unsigned size以允许超过255的大小。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM