Default Teensyduino Libraries


I’m migrating my native Arduino IDE project to PlatformIO and I want to use the usbMIDI Library from the Teensyduino IDE, how can I integrate the default Teensyduino libs in my project?

ok, I just installed the core libraries via the PIO terminal

pio lib -d ./lib install\#1.35

but I’m still getting the error


The Problem seems that the Teensyduino IDE automatically creates the usbMIDI Instance:

// Preinstantiate Objects //////////////////////////////////////////////////////

usb_serial_class	Serial = usb_serial_class();
usb_midi_class		usbMIDI = usb_midi_class();

But even if I’m including the “usb_api.h” in my class I’m getting this error :frowning:

Any suggestions on that?

I’m using the USB MIDI in my current project. Add the following line to platformio.ini:

build_flags = -DUSB_MIDI

Here’s my platformuo.ini file:

platform = teensy
board = teensy31
framework = arduino
build_flags = -DUSB_MIDI

I didn’t have to install anything extra. And thanks, I didn’t know there was a note handler event! You just made my day. I was doing it differently.

Hi James,

thanks for your reply … it solves my problem :thumbsup:
I’m totally new to C++ and I have many “little” issues to deal with … that was one of them :wink:

Regarding the Handler: Teensyduino: Using USB MIDI with Teensy on the Arduino IDE

Currently I’m dealing with passing my member function of my EncoderWrapper-Class to the set[…] functions of usbMIDI … it seems to be very different in C++ to pass functions (in that case a function pointer?) to another function … :worried: