0

我已将我的效果处理器 midi 连接到 shield 中的 arduino midi,我正在尝试使用 arduino 的 Midi 库读取来自我的效果处理器的 sysex 消息,一切运行正常,但是当涉及到十六进制数 F7 时,我的 arduino 读取 0。我知道F7 是 247 有人知道为什么会这样吗?

我使用此代码

#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();
}
4

1 回答 1

1

这在 github 上进行了讨论,看起来这是#67#66修复的错误。处理函数的 args 也发生了变化,第二个 arg 现在unsigned size允许大小超过 255。

于 2019-04-07T21:43:15.527 回答