Skip to content

Commit 15855bb

Browse files
authored
Merge pull request #866 from brentru/update-serial-passthru
Update ESP32 Serial Passthrough for more boards
2 parents d98a3ab + 2b0a2ea commit 15855bb

File tree

1 file changed

+43
-5
lines changed

1 file changed

+43
-5
lines changed

Adafruit_ESP32_Arduino_Demos/SerialESPPassthrough/SerialESPPassthrough.ino

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,58 @@
2323

2424
unsigned long baud = 115200;
2525

26-
#if defined(ADAFRUIT_FEATHER_M4_EXPRESS) || defined(ADAFRUIT_PYBADGE_M4_EXPRESS) || defined(ADAFRUIT_PYGAMER_M4_EXPRESS)
27-
// Configure the pins used for the ESP32 connection via
26+
#if defined(ADAFRUIT_FEATHER_M4_EXPRESS) || \
27+
defined(ADAFRUIT_FEATHER_M0_EXPRESS) || \
28+
defined(ARDUINO_AVR_FEATHER32U4) || \
29+
defined(ARDUINO_NRF52840_FEATHER) || \
30+
defined(ADAFRUIT_ITSYBITSY_M0_EXPRESS) || \
31+
defined(ADAFRUIT_ITSYBITSY_M4_EXPRESS) || \
32+
defined(ARDUINO_AVR_ITSYBITSY32U4_3V)
33+
// Configure the pins used for the ESP32 connection
2834
#define SerialESP32 Serial1
29-
#define SPIWIFI SPI // The SPI port
35+
#define SPIWIFI SPI // The SPI port
3036
#define SPIWIFI_SS 13 // Chip select pin
3137
#define ESP32_RESETN 12 // Reset pin
3238
#define SPIWIFI_ACK 11 // a.k.a BUSY or READY pin
3339
#define ESP32_GPIO0 10
3440
#define NEOPIXEL_PIN 8
41+
#elif defined(ARDUINO_AVR_FEATHER328P)
42+
#define SerialESP32 Serial1
43+
#define SPIWIFI SPI // The SPI port
44+
#define SPIWIFI_SS 4 // Chip select pin
45+
#define ESP32_RESETN 3 // Reset pin
46+
#define SPIWIFI_ACK 2 // a.k.a BUSY or READY pin
47+
#define ESP32_GPIO0 -1
48+
#define NEOPIXEL_PIN 8
49+
#elif defined(TEENSYDUINO)
50+
#define SerialESP32 Serial1
51+
#define SPIWIFI SPI // The SPI port
52+
#define SPIWIFI_SS 5 // Chip select pin
53+
#define ESP32_RESETN 6 // Reset pin
54+
#define SPIWIFI_ACK 9 // a.k.a BUSY or READY pin
55+
#define ESP32_GPIO0 -1
56+
#define NEOPIXEL_PIN 8
57+
#elif defined(ARDUINO_NRF52832_FEATHER )
58+
#define SerialESP32 Serial1
59+
#define SPIWIFI SPI // The SPI port
60+
#define SPIWIFI_SS 16 // Chip select pin
61+
#define ESP32_RESETN 15 // Reset pin
62+
#define SPIWIFI_ACK 7 // a.k.a BUSY or READY pin
63+
#define ESP32_GPIO0 -1
64+
#define NEOPIXEL_PIN 8
65+
#elif !defined(SPIWIFI_SS) // if the wifi definition isnt in the board variant
66+
// Don't change the names of these #define's! they match the variant ones
67+
#define SerialESP32 Serial1
68+
#define SPIWIFI SPI
69+
#define SPIWIFI_SS 10 // Chip select pin
70+
#define SPIWIFI_ACK 7 // a.k.a BUSY or READY pin
71+
#define ESP32_RESETN 5 // Reset pin
72+
#define ESP32_GPIO0 -1 // Not connected
73+
#define NEOPIXEL_PIN 8
3574
#endif
3675

3776
Adafruit_NeoPixel pixel = Adafruit_NeoPixel(1, NEOPIXEL_PIN, NEO_GRB + NEO_KHZ800);
3877

39-
4078
void setup() {
4179
Serial.begin(baud);
4280
pixel.begin();
@@ -72,4 +110,4 @@ void loop() {
72110
pixel.setPixelColor(0, 0, 0, 10); pixel.show();
73111
Serial.write(SerialESP32.read());
74112
}
75-
}
113+
}

0 commit comments

Comments
 (0)