# Configuring the strips

In this tutorial, we will guide you on how to create a separate configuration file (.cfg) in the Klipper Web interface to store LED effect configurations and code, and how to reference it in the main `printer.cfg` file. This approach helps keep your configurations tidy and modular.

## **Create the Configuration File**

1. **Open the Klipper Web Interface**\
   Log in to your Klipper Web interface.
2. **Find Config Files**\
   In the web interface, locate the “Config Files” option.
3. **Create a New File**\
   Click on the “Create File” option, enter the filename, for example: `led_effects.cfg`, and save it.

<figure><img src="/files/tAkhgbj86deK6TyscmvO" alt=""><figcaption></figcaption></figure>

## Editing LED Effect Configuration

In your configuration file, each LED strip connected to an IO pin requires a unique definition. This includes specifying the data pin (and clock pin if needed) and the number of LEDs in the strip. Ensure that each strip is defined by its type first.

{% hint style="info" %}

#### How to Differentiate WS2812、SK6812 and APA102 LEDs by Appearance

* **WS2812** : Have **4 pins**;
* **SK6812** ：Have **4 pins**，Can see a separate white LED on the surface.
* **APA102**: Have **6 pins**; they typically contain a black component inside.

Most of the products available on the market are WS2812 and SK6812.

If you are still unsure, you can directly ask the seller to confirm the type of LED.
{% endhint %}

<figure><img src="/files/1mzgFoHAh2RhIXYSHxkw" alt=""><figcaption></figcaption></figure>

In the newly created `led_effects.cfg` file, add configuration entries for each LED strip on your setup. The pin settings vary based on the type of LED strip you are using:

* **WS2812  (Neopixel LED Strips):** Only the `data_pin` is needed, as these strips use a single-wire communication protocol and don’t require a clock signal. Color order: enter GRB.

  ```ini
  [neopixel name_lights]
  # hotend_rgb is the custom name for this LED strip
  pin:                    # Replace with the actual pin used for RGB LEDs
  chain_count:            # Number of LEDs in the RGBW strip
  color_order: GRB        # Color order for RGBW LEDs
  ```
* **SK6812 (Neopixel LED Strips):** Only the `data_pin` is needed, as these strips use a single-wire communication protocol and don’t require a clock signal. Color order: enter GRBW.

  ```ini
  [neopixel name_lights]
  # hotend_rgb is the custom name for this LED strip
  pin:                    # Replace with the actual pin used for RGB LEDs
  chain_count:            # Number of LEDs in the RGBW strip
  color_order: GRBW       # Color order for RGBW LEDs
  ```
* **APA102 (Dotstar LED Strips):** Both `clock_pin` and `data_pin` are required since these strips use the SPI communication protocol, with the `clock_pin` aiding in stable data transmission:

  ```ini
  [dotstar name_lights]
  # bed_lights is the custom name for this LED strip
  data_pin:               # Data pin connected to the MCU pin
  clock_pin:              # Clock pin connected to the MCU pin (used only for LEDs requiring a clock signal, like APA102)
  chain_count:            # Number of LEDs in the RGBW strip
  color_order: GRB        # Color order for RGBW LEDs
  ```

Use this method to define all LED strips on your printer.

## &#x20;**Modify the `printer.cfg` File**

1. **Open the Main Configuration File**\
   In the Klipper Web interface, find and open the `printer.cfg` file.
2. **Reference the LED Effect Configuration**\
   At the very top of the `printer.cfg` file, add the following line to reference the `led_effects.cfg` file you just created:

   ```ini
   [include led_effects.cfg]
   ```

   Make sure to include the square brackets around the reference.

<figure><img src="/files/RlaEk211TlBSLxkOwZmD" alt=""><figcaption></figcaption></figure>

## **Restart Klipper**

After completing the above steps, you need to restart Klipper for the new configuration to take effect. You can restart it through the control panel in the web interface.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.siboor.com/other-products/led-effect-notes/configuring-the-strips.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
