I’m using PlatformIO on a Mac, and trying to compile a ‘hello world’ using usb midi.
My platformio.ini is:
[env:teensy32]
platform = teensy
board = teensy31
framework = arduino
build_flags = -DUSB_MIDI
And the main.cpp is:
#include <Arduino.h>
void setup() {
usbMIDI.begin();
}
void loop() {
}
When I build, I get the following:
Processing teensy32 (platform: teensy; board: teensy31; framework: arduino)
------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/teensy/teensy31.html
PLATFORM: Teensy (1.6.0) > Teensy 3.1 / 3.2
HARDWARE: MK20DX256 72MHz, 64KB RAM, 256KB Flash
PACKAGES:
- framework-arduinoteensy @ 1.135.0 (1.35)
- toolchain-gccarmnoneeabi @ 1.40804.0 (4.8.4)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 90 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio/build/teensy32/src/main.cpp.o
Compiling .pio/build/teensy32/FrameworkArduino/AudioStream.cpp.o
Compiling .pio/build/teensy32/FrameworkArduino/DMAChannel.cpp.o
Compiling .pio/build/teensy32/FrameworkArduino/HardwareSerial1.cpp.o
Compiling .pio/build/teensy32/FrameworkArduino/HardwareSerial2.cpp.o
Compiling .pio/build/teensy32/FrameworkArduino/HardwareSerial3.cpp.o
Compiling .pio/build/teensy32/FrameworkArduino/HardwareSerial4.cpp.o
Compiling .pio/build/teensy32/FrameworkArduino/HardwareSerial5.cpp.o
Compiling .pio/build/teensy32/FrameworkArduino/HardwareSerial6.cpp.o
Compiling .pio/build/teensy32/FrameworkArduino/IPAddress.cpp.o
Compiling .pio/build/teensy32/FrameworkArduino/IntervalTimer.cpp.o
src/main.cpp: In function 'void setup()':
src/main.cpp:4:3: error: 'usbMIDI' was not declared in this scope
usbMIDI.begin();
^
*** [.pio/build/teensy32/src/main.cpp.o] Error 1
Any ideas what I’m doing wrong?