# Backward direction (move the lit LED from right to left) # range(NUM_LEDS - 2, 0, -1) generates: # For 12 LEDs → 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 # - Start at LED 10 (second-to-last) # - Stop at LED 1 (LED 0 is skipped to avoid repeating the end LED) # - Step backwards by -1 each time for i in range(NUM_LEDS - 2, 0, -1): clear() # Turn all LEDs off before lighting the next one np[i] = color # Light the current LED at position i np.write() # Send the updated LED data to the strip time.sleep(delay) # Pause so the movement is visible