> For the complete documentation index, see [llms.txt](https://www.battlecoder.com/battlecoder/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.battlecoder.com/battlecoder/hardware/gamecube-controller-led-mod.md).

# GameCube Controller LED Mod

## GameCube Motherboard

Solder two wires to the controllers board, one to 5v and the other to ground. Use these two wires to power the Arduino nano.&#x20;

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

## Code

I use the FastLED library to interact with the RGBs I have connected to the Arduino.

```cpp
#include <FastLED.h>

// How many leds in your strip?
#define NUM_LEDS 10

// For led chips like Neopixels, which have a data line, ground, and power, you just
// need to define DATA_PIN.  For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
#define DATA_PIN 3
#define CLOCK_PIN 13

// Define the array of leds
CRGB leds[NUM_LEDS];
int funkytown[] = {9,8,7,6,5,4,3,2,1,0};

void setup() { 
  
      FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
      leds[0] = CRGB(255,0,255);
      FastLED.show();
      leds[1] = CRGB(255,0,255);
      FastLED.show();
      leds[2] = CRGB(255,0,255);
      FastLED.show();
      leds[3] = CRGB(255,0,255);
      FastLED.show();

      for(int i=4; i<=9; i++){
      leds[i] = CRGB(10,0,10);
      FastLED.show();
  }
}

void loop() { 

   for(int i=0; i<=9; i++){
      leds[i] = CRGB(255,0,255);
      FastLED.show();
      delay(120);
      leds[i] = CRGB(0,255,255);
      FastLED.show();
      delay(50);
   }
}
```

## End Product

<figure><img src="/files/oQqgppI32chRCw3AkIhD" alt="" width="375"><figcaption></figcaption></figure>
