6 years, 3 months ago.

midi.read() problem

https://os.mbed.com/users/okini3939/code/MIDI/file/0eeca7deec08/MIDI.cpp/ Library midi.

Hello, I do not arrive has lira message noon(south) with this bookshop! I need help PLEASE!!

Here is the code:

#include "mbed.h"
#include "port.h"
#include "TextLCD.h"
#include "RotaryEncoder.h"

#include "MIDI.h"

TextLCD lcd(PTC17, PTA16, PTA17, PTE31, PTD6, PTD7, TextLCD::LCD16x2); // rs, e, d4-d7, LCDType
RotaryEncoder re(PTE2, PTB11);


extern int rotary_positif, rotary_negatif;
int ch_in = 0, prgext = 0, ok = 0, prgext2 = 0, x = 0;

char y;

int main() 
{//main

    
    MIDI midi(PTE0,PTE1);
    midi.begin();
    
while(1)
{//General   

        midi.read(); ch_in = midi.getChannel(); 
        midi.read(); prgext = midi.getData1();   
        midi.read(); prgext2 = midi.getData2(); 
        lcd.locate(0,0); lcd.printf("Ch<%d,%d,%d,  ",ch_in,prgext,prgext2 + 1);

        
 }//General
}//main   

1 Answer

6 years, 3 months ago.

Here's an adapter code between mbed's Serial API and the official Arduino MIDI Library (^4.3), with an example on how to connect them: https://github.com/FortySevenEffects/mbed-midi-adapter

Accepted Answer