Skip to content

Commit 848777a

Browse files
author
brentru
committed
default to predefined pins, make external pin def optional
1 parent 4e48e69 commit 848777a

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

examples/esp32spi_aio_post.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,17 @@
1515
print("WiFi secrets are kept in secrets.py, please add them there!")
1616
raise
1717

18-
# If you have an externally connected ESP32:
19-
esp32_cs = DigitalInOut(board.D9)
20-
esp32_ready = DigitalInOut(board.D10)
21-
esp32_reset = DigitalInOut(board.D5)
22-
2318
# If you are using a board with pre-defined ESP32 Pins:
24-
"""
2519
esp32_cs = DigitalInOut(board.ESP_CS)
2620
esp32_ready = DigitalInOut(board.ESP_BUSY)
2721
esp32_reset = DigitalInOut(board.ESP_RESET)
28-
"""
2922

23+
# If you have an externally connected ESP32:
24+
"""
25+
esp32_cs = DigitalInOut(board.D9)
26+
esp32_ready = DigitalInOut(board.D10)
27+
esp32_reset = DigitalInOut(board.D5)
28+
"""
3029

3130
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
3231
esp = adafruit_esp32spi.ESP_SPIcontrol(spi, esp32_cs, esp32_ready, esp32_reset)

examples/esp32spi_simpletest.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111
JSON_URL = "http://api.coindesk.com/v1/bpi/currentprice/USD.json"
1212

1313

14-
# If you have an externally connected ESP32:
15-
esp32_cs = DigitalInOut(board.D9)
16-
esp32_ready = DigitalInOut(board.D10)
17-
esp32_reset = DigitalInOut(board.D5)
18-
1914
# If you are using a board with pre-defined ESP32 Pins:
20-
"""
2115
esp32_cs = DigitalInOut(board.ESP_CS)
2216
esp32_ready = DigitalInOut(board.ESP_BUSY)
2317
esp32_reset = DigitalInOut(board.ESP_RESET)
18+
19+
# If you have an externally connected ESP32:
20+
"""
21+
esp32_cs = DigitalInOut(board.D9)
22+
esp32_ready = DigitalInOut(board.D10)
23+
esp32_reset = DigitalInOut(board.D5)
2424
"""
2525

2626
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)

0 commit comments

Comments
 (0)