File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,6 +111,7 @@ In Arduino IDE, go to **Tools > USB** and select **"Adafruit TinyUSB"**
111111
112112Here's a simple USB MIDI example:
113113``` cpp
114+ #define Serial SerialTinyUSB //Alias to allow Serial Communication throguh TinyUSB
114115#include <Adafruit_TinyUSB.h>
115116#include <MIDI.h>
116117
@@ -139,7 +140,27 @@ void loop() {
139140 }
140141}
141142```
143+ ## Using Serial Monitor with TinyUSB
142144
145+ TinyUSB creates a USB CDC serial port called `SerialTinyUSB`. To use the Arduino Serial Monitor:
146+
147+ **Option 1: Use SerialTinyUSB directly**
148+ ```cpp
149+ SerialTinyUSB.begin(115200);
150+ SerialTinyUSB.println("Hello!");
151+ ```
152+
153+ ** Option 2: Alias Serial (recommended for code portability)**
154+ ``` cpp
155+ #define Serial SerialTinyUSB
156+
157+ void setup () {
158+ Serial.begin(115200);
159+ Serial.println("Hello!");
160+ }
161+ ```
162+
163+ Add the ` #define ` at the top of your sketch before any other includes.
143164## Technical Details
144165
145166### Key Implementation Notes
You can’t perform that action at this time.
0 commit comments