# NeoPixel WS2812 LED Setup Instruction

## PX4 NeoPixel Setup Guide

{% hint style="warning" %}
Note: This is experimental at the moment. Please operate with caution.
{% endhint %}

The official release of PX4 firmware does not support NeoPixel at the moment. However, you could flash the custom firmware (based on v1.15beta1) below and set up NeoPixel at the Actuator tab in QGroundControl.&#x20;

{% file src="<https://2367252986-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLIgtGDAvVGkCKGOJb1bR%2Fuploads%2Famki99c0zjaiNzjp7THK%2Fpx4_fmu-v6x_x650-rev2.px4?alt=media&token=f12c854c-1654-4305-989f-950330c424df>" %}
Pixhawk v6x binary
{% endfile %}

Make sure your NeoPixel LEDs are connected to the AUX PWM outputs. MAIN PWM outputs do not support NeoPixel.

<figure><img src="https://2367252986-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLIgtGDAvVGkCKGOJb1bR%2Fuploads%2FRFJZ7Sawc4fhreVdtnrC%2Fneopixel_qgc.png?alt=media&#x26;token=9343acad-9539-411b-bc64-30847194af34" alt=""><figcaption></figcaption></figure>

## Ardupilot NeoPixel Setup Guide

Follow the instruction below to set this up.

* Set [NTF\_LED\_TYPES](https://ardupilot.org/copter/docs/parameters.html#ntf-led-types) to include NeoPixel

<figure><img src="https://2367252986-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLIgtGDAvVGkCKGOJb1bR%2Fuploads%2Fa0BGDAqE0y54Gx8ZkeXq%2Fimage.png?alt=media&#x26;token=7b639390-fd84-4a45-bc55-1786f4bc2940" alt=""><figcaption></figcaption></figure>

* Setup LED Parameter：

  * &#x20;[NTF\_LED\_BRIGHT:](https://ardupilot.org/copter/docs/parameters.html#ntf-led-bright-led-brightness) 3
  * &#x20;[NTF\_LED\_LEN](https://ardupilot.org/copter/docs/parameters.html#ntf-led-len) : 4
  * &#x20;[NTF\_LED\_OVERRIDE](https://ardupilot.org/copter/docs/parameters.html#ntf-led-override-specifies-colour-source-for-the-rgbled): 0

  <figure><img src="https://2367252986-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLIgtGDAvVGkCKGOJb1bR%2Fuploads%2F9H1TQ5he7i71syAHgWQf%2Fimage.png?alt=media&#x26;token=e64c2bff-2b1a-41c1-84f9-f464576937f1" alt=""><figcaption></figcaption></figure>
* In this example, we connected the wiring as follow:

  * Motor 1 LED -> AUX (FMU) PWM 1
  * Motor 2 LED -> AUX (FMU) PWM 2
  * Motor 3 LED -> AUX (FMU) PWM 3
  * Motor 4 LED -> AUX (FMU) PWM 4

  <figure><img src="https://2367252986-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLIgtGDAvVGkCKGOJb1bR%2Fuploads%2FqNFi37ca9AiQnEccSrKF%2FCleanShot%202024-06-07%20at%2013.49.09.png?alt=media&#x26;token=390a6e06-91bf-4a19-af25-63c7478c7177" alt="" width="287"><figcaption><p>Ardupilot Default Motor# &#x26; Direction (Quad X)</p></figcaption></figure>
* In the Servo Output Page, set:
  * &#x20;\#9 function -> NeoPixel1&#x20;
  * &#x20;\#10 function -> NeoPixel2
  * &#x20;\#11 function -> NeoPixel3&#x20;
  * &#x20;\#12 function -> NeoPixel4&#x20;

<figure><img src="https://2367252986-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLIgtGDAvVGkCKGOJb1bR%2Fuploads%2FUzeqkVXrSGpx6zG0I7px%2Fimage.png?alt=media&#x26;token=fa33cbed-9034-4bf0-b104-a44989c7d26e" alt=""><figcaption></figcaption></figure>
