How to make MIDI a global, shared between cpp files?
KarolPtak opened this issue · 1 comments
KarolPtak commented
I have 4 classes (each in separate cpp + h files),
and I'd like to share the midi instance between them, but I'm stuck :( .
Basicly calling MIDI_CREATE_DEFAULT_INSTANCE(); in the main .ino file makes it unvisible to those classes.
I've tried to create say 'global.h' with
#include <MIDI.h>
extern MidiInterface MIDI;
and 'global.cpp' with
#include <MIDI.h>
MidiInterface MIDI = MIDI_CREATE_DEFAULT_INSTANCE();
but the result is
error: 'MidiInterface' does not name a type
extern MidiInterface MIDI;