Skip to content

Commit 7389070

Browse files
committed
Use Wemos D1 mini GPIO defines in onewiretest to make it more self-descriptive for test setup.
1 parent 7774023 commit 7389070

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

examples/onewiretest/onewiretest.ino

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
11
#include <ESP8266WiFi.h>
22
#include "SoftwareSerial.h"
33

4+
#ifndef D5
5+
#if defined(ESP8266)
6+
#define D5 (14)
7+
#define D6 (12)
8+
#elif defined(ESP32)
9+
#define D5 (18)
10+
#define D6 (19)
11+
#endif
12+
#endif
13+
414
SoftwareSerial swSer1;
515
SoftwareSerial swSer2;
616

717
void setup() {
818
delay(2000);
919
Serial.begin(115200);
1020
Serial.println(PSTR("\nOne Wire Half Duplex Serial Tester"));
11-
swSer1.begin(115200, SWSERIAL_8N1, 12, 12, false, 256);
21+
swSer1.begin(115200, SWSERIAL_8N1, D6, D6, false, 256);
1222
// high speed half duplex, turn off interrupts during tx
1323
swSer1.enableIntTx(false);
14-
swSer2.begin(115200, SWSERIAL_8N1, 14, 14, false, 256);
24+
swSer2.begin(115200, SWSERIAL_8N1, D5, D5, false, 256);
1525
// high speed half duplex, turn off interrupts during tx
1626
swSer2.enableIntTx(false);
1727
}

0 commit comments

Comments
 (0)