@@ -38,6 +38,11 @@ byte note_sequence[] = {
3838
3939void setup ()
4040{
41+ #if defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARCH_RP2040)
42+ // Manual begin() is required on core without built-in support for TinyUSB such as mbed rp2040
43+ TinyUSBDevice.begin (0 );
44+ #endif
45+
4146 pinMode (LED_BUILTIN, OUTPUT);
4247
4348 // usb_midi.setStringDescriptor("TinyUSB MIDI");
@@ -98,13 +103,25 @@ void loop()
98103void handleNoteOn (byte channel, byte pitch, byte velocity)
99104{
100105 // Log when a note is pressed.
101- Serial.printf (" Note on: channel = %d, pitch = %d, velocity - %d" , channel, pitch, velocity);
102- Serial.println ();
106+ Serial.print (" Note on: channel = " );
107+ Serial.print (channel);
108+
109+ Serial.print (" pitch = " );
110+ Serial.print (pitch);
111+
112+ Serial.print (" velocity = " );
113+ Serial.println (velocity);
103114}
104115
105116void handleNoteOff (byte channel, byte pitch, byte velocity)
106117{
107118 // Log when a note is released.
108- Serial.printf (" Note off: channel = %d, pitch = %d, velocity - %d" , channel, pitch, velocity);
109- Serial.println ();
119+ Serial.print (" Note off: channel = " );
120+ Serial.print (channel);
121+
122+ Serial.print (" pitch = " );
123+ Serial.print (pitch);
124+
125+ Serial.print (" velocity = " );
126+ Serial.println (velocity);
110127}
0 commit comments