QT Py ESP32-S2 digitalInOut pins not working

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
jehan60188
 
Posts: 15
Joined: Mon Feb 08, 2021 12:17 pm

QT Py ESP32-S2 digitalInOut pins not working

Post by jehan60188 »

Trying to get wifi working. The code below doesn't work.

source: https://learn.adafruit.com/adafruit-io- ... et-connect

Code: Select all

# If you are using a board with pre-defined ESP32 Pins:
esp32_cs = DigitalInOut(board.ESP_CS)
esp32_ready = DigitalInOut(board.ESP_BUSY)
esp32_reset = DigitalInOut(board.ESP_RESET)

# If you have an externally connected ESP32:
#esp32_cs = DigitalInOut(board.D9)
#esp32_ready = DigitalInOut(board.D10)
#esp32_reset = DigitalInOut(board.D5)
Tried both ways to define esp32_cs, but get the following error: `AttributeError: 'module' object has no attribute 'ESP_CS'`


Has anyone got wifi working?

edit:
`dir(board)` returns the following
['__class__', '__name__', 'A0', 'A1', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'BOOT0', 'BUTTON', 'D0', 'D16', 'D17', 'D18', 'D35', 'D36', 'D37', 'D40', 'D41', 'D5', 'D6', 'D7', 'D8', 'D9', 'I2C', 'MISO', 'MOSI', 'NEOPIXEL', 'NEOPIXEL_POWER', 'RX', 'SCK', 'SCL', 'SCL1', 'SDA', 'SDA1', 'SPI', 'STEMMA_I2C', 'TX', 'UART', 'board_id']

and `board.board_id` is `adafruit_qtpy_esp32s2`

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: QT Py ESP32-S2 digitalInOut pins not working

Post by mikeysklar »

The code example you linked to looks taylored to a board with a ESP32 coprocessor or AirLift addition.

Since your Qt Py ESP32-S2 is a single processor with WiFi built in I'd try using this script which is not going through a SPI connection.

https://learn.adafruit.com/adafruit-qt- ... ernet-test

User avatar
jehan60188
 
Posts: 15
Joined: Mon Feb 08, 2021 12:17 pm

Re: QT Py ESP32-S2 digitalInOut pins not working

Post by jehan60188 »

Thanks, that example worked like a charm!

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: QT Py ESP32-S2 digitalInOut pins not working

Post by mikeysklar »

Excellent. Thank you for the confirmation.

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”