File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
ESP32_S2_WiFi_Tests/JSONdemo Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -199,13 +199,23 @@ void loop() {
199199
200200void setupI2C () {
201201 #if defined(ARDUINO_ADAFRUIT_QTPY_ESP32S2) || defined(ARDUINO_ADAFRUIT_QTPY_ESP32_PICO)
202- // ESP32 is kinda odd in that secondary ports must be manually
203- // assigned their pins with setPins()!
204- Wire1.setPins (SDA1, SCL1);
202+ // ESP32 is kinda odd in that secondary ports must be manually
203+ // assigned their pins with setPins()!
204+ Wire1.setPins (SDA1, SCL1);
205205 #endif
206+
206207 #if defined(NEOPIXEL_I2C_POWER)
207- pinMode (NEOPIXEL_I2C_POWER, OUTPUT);
208- digitalWrite (NEOPIXEL_I2C_POWER, HIGH); // on
208+ pinMode (NEOPIXEL_I2C_POWER, OUTPUT);
209+ digitalWrite (NEOPIXEL_I2C_POWER, HIGH); // on
210+ #endif
211+
212+ #if defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2)
213+ // turn on the I2C power by setting pin to opposite of 'rest state'
214+ pinMode (PIN_I2C_POWER, INPUT);
215+ delay (1 );
216+ bool polarity = digitalRead (PIN_I2C_POWER);
217+ pinMode (PIN_I2C_POWER, OUTPUT);
218+ digitalWrite (PIN_I2C_POWER, !polarity);
209219 #endif
210220}
211221
You can’t perform that action at this time.
0 commit comments