Pages: [1]   Go Down
Author Topic: MIDI library doesn't work on Arduino Due  (Read 1017 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
#include <MIDI.h>

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


void loop() {
 
MIDI.read();

}
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

0
Offline Offline
God Member
*****
Karma: 26
Posts: 626
Always making something...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Pages: [1]   Go Up
Jump to: