> For the complete documentation index, see [llms.txt](https://longer-vision-robot.gitbook.io/arduino-full-stack/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://longer-vision-robot.gitbook.io/arduino-full-stack/03_led_sensors/009_miniled_rg.md).

# 3.3 Mini LED Red Green GND-Shared

## Hardware Wiring

![Mini LED Red Green](/files/-LCFE9xaeSv5BWEjykz-)

## Sketch

The code can be found at [Examples\_Arduino - sensor-kit-for-arduino - \_009\_MiniLED\_RG - \_009\_MiniLED\_RG.ino](https://github.com/LongerVisionRobot/Examples_Arduino/tree/master/sensor-kit-for-arduino/_009_MiniLED_RG/_009_MiniLED_RG.ino).

```
 //Arduino test code:
int redpin = 11;  // select the pin for the red LED
int bluepin =10;  // select the pin for the blueLED
int val;
void setup() {
  pinMode(redpin, OUTPUT);
  pinMode(bluepin, OUTPUT);
  Serial.begin(9600);
}

void loop() 
{
for(val=255; val>0; val--)
  {
   analogWrite(11, val);
   analogWrite(10, 255-val);
   delay(15); 
  }
for(val=0; val<255; val++)
  {
   analogWrite(11, val);
   analogWrite(10, 255-val);
   delay(15); 
  }
 Serial.println(val, DEC);
}
```
