Skip to content

Commit 5389565

Browse files
committed
Created an advance example that uses SoftwareSerial
1 parent eb3238b commit 5389565

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Advanced Debug can be helpful in embedded applications when
3+
* there are more that two microcontrollers connected serially
4+
* or a wireless sensor like Xbee is connected to the serial port
5+
* that will send data wirelessly to other Xbee node.
6+
*
7+
* In boards like Ardunino Nano, UNO, MEGA only one serial port is available,
8+
* therefore additional Software Serial ports can be made usinf SoftwareSerial
9+
*/
10+
11+
#include "Arduino_DebugUtils.h"
12+
#include <SoftwareSerial.h>
13+
14+
SoftwareSerial mySerial(10, 11); // RX, TX
15+
16+
void setup() {
17+
mySerial.begin(9600);
18+
Debug.setDebugOutputStream(&mySerial);
19+
Debug.setDebugLevel(DBG_VERBOSE);
20+
Debug.timestampOn();
21+
}
22+
23+
int i = 0;
24+
25+
void loop() {
26+
Debug.print(DBG_VERBOSE, "i = %d", i);
27+
i++;
28+
delay(1000);
29+
}

0 commit comments

Comments
 (0)