Skip to content

Commit

Permalink
Use just one MKR board to do both Serial and Eslov Passthrough
Browse files Browse the repository at this point in the history
  • Loading branch information
giulcioffi committed Apr 1, 2021
1 parent 2f2211a commit 2f5d7eb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Arduino_BHY2_HOST/examples/Passthrough/Passthrough.ino
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@
// Set DEBUG to true in order to enable debug print
#define DEBUG false

Serial_ SerialUSB2(USBDevice);

void setup()
{
Serial.begin(115200);
Serial1.begin(115200);
SerialUSB2.begin(115200);
#if DEBUG
// When the passthrough is enabled, Serial is busy ->
// so it cannot be used for debugging. Serial1 is used instead
Serial1.begin(115200);
BHY2_HOST.debug(Serial1);
#endif

Expand All @@ -27,5 +31,8 @@ void setup()

void loop()
{
if (Serial1.available()) {
SerialUSB2.write(Serial1.read());
}
BHY2_HOST.update();
}

0 comments on commit 2f5d7eb

Please sign in to comment.