#include <SPI.h>
#include <Wire.h>
#include "display.h"
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <MIDI.h>
#include "Rotary.h"

extern Rotary r;
const int myPins[] = {PIN_PA7, PIN_PA6, PIN_PA5, PIN_PA4, PIN_PA3, PIN_PA2, PIN_PA1, PIN_PA0, PIN_PF6, PIN_PF5, PIN_PF4, PIN_PF3, PIN_PF2, PIN_PF1, PIN_PF0, PIN_PB0, PIN_PG4, PIN_PG3, PIN_PG2, PIN_PG1, PIN_PG0, PIN_PB5, PIN_PB6, PIN_PB7, PIN_PE7, PIN_PD4, PIN_PD5, PIN_PD6, PIN_PD7, PIN_PC0, PIN_PC1, PIN_PC2, PIN_PC3, PIN_PC4, PIN_PC5, PIN_PC6, PIN_PC7};
extern int counter;
extern bool Inst;
extern int MIDIChannel;

extern unsigned long previousMillis;        
extern unsigned long currentMillis;

extern MIDI_NAMESPACE::MidiInterface<MIDI_NAMESPACE::SerialMIDI<HardwareSerial>> MyMIDI;

void StateMachine();

