我已将我的效果处理器 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();
}