# 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>


---

# 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://www.battlecoder.com/battlecoder/hardware/gamecube-controller-led-mod.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.
