ESP32-S2 and test bed / I2C code

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
CuGat
 
Posts: 8
Joined: Mon Nov 14, 2022 1:53 am

ESP32-S2 and test bed / I2C code

Post by CuGat »

The example code at:

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

includes the following lines:

Code: Select all

void setup() {
  Serial.begin(115200);

  // Wait for Serial port to open
  while (!Serial) {
    delay(10);
  }
  delay(500);
  Serial.println("Adafruit I2C Scanner");
 
...

On a QT-PY ESP32-S2 connected by JST to a p/n 5640 clock generator, the code never exits the while loop for some reason(Arduino IDE 2.0.1) and nothing appears in the serial monitor window. Slowing the while loop does not work to fix the problem. Commenting out the while loop allows the code to execute normally and return the correct i2C address of the clock generator to the serial monitor. Why does the while loop fail?

User avatar
adafruit_support_carter
 
Posts: 29056
Joined: Tue Nov 29, 2016 2:45 pm

Re: ESP32-S2 and test bed / I2C code

Post by adafruit_support_carter »

Not sure. Tested here and can not recreate that behavior. The loop is intended to wait until the Serial Monitor is opened before proceeding with the rest of the output.

Are you sure you're opening the correct COM port in the Serial Monitor? Double check the Tools->Port setting before opening it.

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

Return to “Other Arduino products from Adafruit”