Skip to content

Commit 87f9e43

Browse files
committed
enable neopixel and i2c on feather by default
1 parent 5380c4d commit 87f9e43

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Diff for: variants/adafruit_feather_esp32s2/pins_arduino.h

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#define NEOPIXEL_NUM 1 // number of neopixels
2626
#define NEOPIXEL_POWER 21 // power pin
2727
#define NEOPIXEL_POWER_ON HIGH // power pin state when on
28+
#define PIN_I2C_POWER 7 // Ppwer pin for I2C
2829

2930
static const uint8_t SDA = 3;
3031
static const uint8_t SCL = 4;

Diff for: variants/adafruit_feather_esp32s2/variant.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,15 @@ extern "C" {
3131
// Initialize variant/board, called before setup()
3232
void initVariant(void)
3333
{
34+
// This board has a power control pin, and we must set it to output and high
35+
// in order to enable the NeoPixels.
36+
pinMode(NEOPIXEL_POWER, OUTPUT);
37+
digitalWrite(NEOPIXEL_POWER, HIGH);
3438

39+
// This board has a power control pin, and we must set it to output and low
40+
// in order to enable the I2C port.
41+
pinMode(PIN_I2C_POWER, OUTPUT);
42+
digitalWrite(PIN_I2C_POWER, LOW);
3543
}
3644

3745
}

0 commit comments

Comments
 (0)