Teensy2.0 usb type midi

How can one use “USB type: MIDI” (during build) like in Arduino IDE, so the platform understands the standard functions in usbMIDI namespace?

platform.ini:

[env:teensy20]
platform = teensy
framework = arduino
board = teensy20
build_flags = -DUSB-MIDI

It should be USB_MIDI. See example https://github.com/platformio/platformio-examples/blob/develop/teensy/teensy-hid-usb-mouse/platformio.ini

OH, yeah, yeah, I pasted it wrongly, in my code it’s actually build_flags = -DUSB_MIDI (or build_flags = -USB_MIDI, the same), but it keeps throwing the exception: error: 'usbMIDI was not declared in this scope. I’ve seen this error before in Arduino IDE, when USB type is not properly set to MIDI.

This is our bug:

  1. Please open an issue for that here Issues · platformio/platformio-core · GitHub
  2. Please navigate to ~/.platformio/packages/framework-arduinoteensy/cores/teensy and remove usb_serial folder
  3. Copy ~/.platformio/packages/framework-arduinoteensy/cores/usb_midi to ~/.platformio/packages/framework-arduinoteensy/cores/teensy

Did it help?

Thanks for your cooperation, however steps 2 and/or 3 didn’t resolve the problem. I logged an issue here: Cannot build Teensy20 project with USB Type: "MIDI" · Issue #722 · platformio/platformio-core · GitHub

Cheers.

Fixed in

By the way the same problem can be reproduced with Atom IDE, if you click “Build” from the graphical interface OR open a console window from IDE and type pio run.

Could you re-test it with PlatformIO 3.0?

Sorry, didn’t want to upgrade, I was in the middle of something. Now I tested with v3 and so far everything seem to work correctly.

Thanks.