Go Down

Topic: MIDI library doesn't work on Arduino Due (Read 1 time) previous topic - next topic

schiller

Well, the midi library doesn't work on Arduino Due.

I'm strongly disappointed in this.

Each time i try to compile a midi sketch, the following error occour:


In file included from /Applications/Arduino .app/Contents/Resources/Java/hardware/arduino/sam/cores/arduino/Arduino.h:36,
                 from MIDI_Basic_IO_edited.ino:3:
/Applications/Arduino .app/Contents/Resources/Java/hardware/arduino/sam/cores/arduino/wiring_constants.h:90: error: conflicting declaration 'typedef unsigned int word'
/Users/schiller/Documents/Arduino/libraries/MIDI/MIDI.h:65: error: 'word' has a previous declaration as 'typedef uint16_t word'


Generic code:

Code: [Select]
#include <MIDI.h>

void setup() {
 
  MIDI.begin();
}


void loop() {
 
MIDI.read();

}

schiller

Solved it

I edited the MIDI.h file with a text editor application.

Basically, i replaced this line

Quote
ypedef uint16_t word'


with this one

Quote
typedef unsigned int word


according to the declaration in wiring_constants file.

Now it works fine, but if anyone would suggest another way to fix that problem, suggestions are wellcome!

Paul Stoffregen

We had this same problem on Teensy 3.0.

It turns out that line is never used.  You can simply delete it without any problems.


Go Up