user3488022
user3488022

Reputation: 25

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?

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

Upvotes: 0

Views: 470

Answers (1)

KevinJWalters
KevinJWalters

Reputation: 193

This was discussed on github and it looks like it was a bug fixed by either #67 or #66. The args for handler function changed too, second arg is now unsigned size to allow for size beyond 255.

Upvotes: 1

Related Questions