Skip to content

Commit 8e74f2a

Browse files
authored
Merge pull request #2908 from FoamyGuy/tft_spirit_board
Spirit Board update
2 parents 8cf838f + ebf338d commit 8e74f2a

File tree

12 files changed

+1026
-82
lines changed

12 files changed

+1026
-82
lines changed

TFT_Spirit_Board/esp32s3_s2_tft_featherwing_480x320/anchored_tilegrid.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

TFT_Spirit_Board/esp32s3_s2_tft_featherwing_480x320/code.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,23 @@
4242
i2c = board.I2C()
4343
tsc = adafruit_tsc2007.TSC2007(i2c, irq=None)
4444

45-
# Initialize a requests session
46-
pool = adafruit_connection_manager.get_radio_socketpool(wifi.radio)
47-
ssl_context = adafruit_connection_manager.get_radio_ssl_context(wifi.radio)
48-
requests = adafruit_requests.Session(pool, ssl_context)
49-
50-
# Set your Adafruit IO Username and Key in secrets.py
51-
# (visit io.adafruit.com if you need to create an account,
52-
# or if you need your Adafruit IO key.)
53-
aio_username = os.getenv("AIO_USERNAME")
54-
aio_key = os.getenv("AIO_KEY")
55-
56-
# Initialize an Adafruit IO HTTP API object
57-
io = IO_HTTP(aio_username, aio_key, requests)
45+
try:
46+
# Initialize a requests session
47+
pool = adafruit_connection_manager.get_radio_socketpool(wifi.radio)
48+
ssl_context = adafruit_connection_manager.get_radio_ssl_context(wifi.radio)
49+
requests = adafruit_requests.Session(pool, ssl_context)
50+
51+
# Set your Adafruit IO Username and Key in secrets.py
52+
# (visit io.adafruit.com if you need to create an account,
53+
# or if you need your Adafruit IO key.)
54+
aio_username = os.getenv("AIO_USERNAME")
55+
aio_key = os.getenv("AIO_KEY")
56+
57+
# Initialize an Adafruit IO HTTP API object
58+
io = IO_HTTP(aio_username, aio_key, requests)
59+
except (RuntimeError, TypeError) as e:
60+
print("could not connect to AP or AdafruitIO: ", e)
61+
io = None
5862

5963
# initialize the SpiritBoard class
6064
spirit_board = SpiritBoard(display)

TFT_Spirit_Board/esp32s3_s2_tft_featherwing_480x320/spirit_board.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)