diff --git a/Adafruit_NeoPixel.cpp b/Adafruit_NeoPixel.cpp index c4f7d30a..e2349842 100644 --- a/Adafruit_NeoPixel.cpp +++ b/Adafruit_NeoPixel.cpp @@ -2169,14 +2169,17 @@ void Adafruit_NeoPixel::show(void) { void Adafruit_NeoPixel::setPin(uint16_t p) { if(begun && (pin >= 0)) { #if defined(AM_PART_APOLLO3) + // The pin has already been mapped to the Apollo3 pad apollo3UnsetPin(pin); #endif pinMode(pin, INPUT); } - pin = p; #if defined(AM_PART_APOLLO3) - apollo3SetPin(pin); + // Map the specified pin to the Apollo3 pad + p = ap3_gpio_pin2pad(p); + apollo3SetPin(p); #endif + pin = p; if(begun) { pinMode(p, OUTPUT); digitalWrite(p, LOW);