 #include <SPI.h>
 #include <Wire.h>
 #include <stdio.h>
+
+#include <string.h>
+#include <stdlib.h>
 
 
 

  // Do something here with your data!
  display.clearDisplay();
  display.setCursor(0, 0);
  display.println("MIDI CC");
  display.display();
}


/**
   MIDI SysEx
*/
void handleSysEx(byte * sysEx, unsigned buffSize) {
  //header f0 00 00 66 05 00
  //

  if (sysEx[5] == 0x12) {
    handleScribble(sysEx, buffSize);
  }

}



  // Reading MIDI messages,

  MIDI.read();

  byte data = MIDI.getData1();
  byte data2 = MIDI.getData2();

/*
  if (MIDI.getType() == 0xD0) { //metering?
    if (data != 0) {
      handleMetering(data);
    }
  }
  */
   if (MIDI.getType() == 0x90) { //select?
    if (data != 0 && data == 0x18) {
      currentDisp = 0;
    } 
    else if(data != 0 && data == 0x19){
      currentDisp = 1;
    }
    else if(data != 0 && data == 0x1A){
      currentDisp = 2;
    }
    refreshLCD();
   }
}


