I'm attempting to multiplex Neopixel data with weird readings on my Oscilloscope (I'm very novice to Electrical Engineering, so maybe it's a simple fix?). Here's my set up; I have a ring of 16 Neopixels, a rotary encoder, an Arduino Nano, and a 74LVC1G157 multiplexer (single, 2-input MUX). The two data inputs I'm using for the MUX are pins D6 and D5; in which pin D6 displays a continuous rainbow, D5 shows a solid color when someone turns the rotary encoder, and pin D4 will switch that input from D6 to D5 when the rotary encoder is turned, with the output pin on the MUX connected to the Data-In pin on the Neopixel ring. I'm also attaching my code for all of this, although the code is working just fine when I manually connect pins D5 and D6 to the Neopixel's Data In pin and turn the rotary encoder. What I can't understand is why the MUX signal is off by around 480mV, when comparing the signal from D6 and D5 before it passes through the MUX (i.e., the purple line on the oscilloscope) to the signal at the output of the MUX (i.e., the yellow line on the oscilloscope). The purple line on the oscilloscope is a perfect Neopixel signal, and the yellow line also has the correct timing, but not the correct triggering voltage??? Link to the Neopixel Uberguide is here. From the picture of my set-up, I also have a 0.1uF capacitor across 5volt and GND and all the components are being powered by 5volts, which is the only thing I could find when searching for this....I am at a loss, please helpenter image description here

#define ENCODER_PIN_A 2 // Quadrature encoder pin A
#define ENCODER_PIN_B 3 // Quadrature encoder pin B
#define MULTIPLEXER_PIN 4 // Pin to control the multiplexer (High/Low)
#define SOLID_COLOR_PIN 5 // Pin to output solid color mode
#define RAINBOW_PIN 6 // Pin to output continuous rainbow mode
#define NUM_LEDS 16 // Number of LEDs in the NeoPixel ring
#define INACTIVITY_TIMEOUT 5000 // 5-second timeout for inactivity
Adafruit_NeoPixel solidRing(NUM_LEDS, SOLID_COLOR_PIN, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel rainbowRing(NUM_LEDS, RAINBOW_PIN, NEO_GRB + NEO_KHZ800);
volatile int16_t encoderPosition = 0;
unsigned long lastEncoderMoveTime = 0;
bool encoderMoved = false;
void setup() {
pinMode(ENCODER_PIN_A, INPUT_PULLUP);
pinMode(ENCODER_PIN_B, INPUT_PULLUP);
pinMode(MULTIPLEXER_PIN, OUTPUT);
Serial.begin(115200);
Serial.println("Setup complete!");
attachInterrupt(digitalPinToInterrupt(ENCODER_PIN_A), readEncoder, CHANGE);
attachInterrupt(digitalPinToInterrupt(ENCODER_PIN_B), readEncoder, CHANGE);
solidRing.begin();
rainbowRing.begin();
solidRing.setBrightness(80);
rainbowRing.setBrightness(80);
solidRing.show(); // Initialize all LEDs to off
rainbowRing.show(); // Initialize all LEDs to off
}
void loop() {
unsigned long currentTime = millis();
if (encoderMoved) {
encoderMoved = false;
lastEncoderMoveTime = currentTime;
// Drive the multiplexer pin high for solid color mode
digitalWrite(MULTIPLEXER_PIN, HIGH);
// Handle counter logic
if (encoderPosition > 255) encoderPosition = 1;
if (encoderPosition < 0) encoderPosition = 0;
if (encoderPosition == 0) {
solidRing.clear();
} else {
uint32_t color = Wheel(encoderPosition & 255);
for (int i = 0; i < NUM_LEDS; i++) {
solidRing.setPixelColor(i, color);
}
solidRing.show();
}
Serial.print("Encoder Position: ");
Serial.print(encoderPosition);
Serial.println(" | Solid Color Mode Active");
}
else if (currentTime - lastEncoderMoveTime > INACTIVITY_TIMEOUT) {
digitalWrite(MULTIPLEXER_PIN, LOW);
displayRainbowEffect();
delay(100); // Delay to ensure smooth transition and prevent rapid switching
}
}
void displayRainbowEffect() {
for (int i = 0; i < NUM_LEDS; i++) {
rainbowRing.setPixelColor(i, Wheel((i + millis() / 10) & 255));
}
rainbowRing.show();
Serial.println("Displaying Rainbow Effect...");
}
void readEncoder() {
int MSB = digitalRead(ENCODER_PIN_A);
int LSB = digitalRead(ENCODER_PIN_B);
int encoded = (MSB << 1) | LSB;
static int lastEncoded = 0;
int sum = (lastEncoded << 2) | encoded;
if (sum == 0b1101 || sum == 0b0100 || sum == 0b0010 || sum == 0b1011) encoderPosition++;
if (sum == 0b1110 || sum == 0b0111 || sum == 0b0001 || sum == 0b1000) encoderPosition--;
lastEncoded = encoded;
encoderMoved = true;
}
uint32_t Wheel(uint8_t WheelPos) {
WheelPos = 255 - WheelPos;
if (WheelPos < 85) {
return solidRing.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
} else if (WheelPos < 170) {
WheelPos -= 85;
return solidRing.Color(255 - WheelPos * 3, 0, WheelPos * 3);
} else {
WheelPos -= 170;
return solidRing.Color(0, WheelPos * 3, 255 - WheelPos * 3);
}
}