Controlling a Three LEDs using GPIO Pins

This project is to turn on and off three LEDs using GPIO commands using Raspberry Pi's GPIO pins. Below the connection Diagram,


GPIO Pins Used
GPIO 0 or GPIO 17(as per Broadcom) - 11th pin. see GPIO Mappings - Conected to the positive end of RED LED
GPIO 1 or GPIO 18(as per Broadcom) - 12th pin - Conected to the positive end of Yellow LED
GPIO 2 or GPIO 21(as per Broadcom) - 13th pin - Conected to the positive end of Green LED
6th pin of GPIO (ground 0V) - Connected to the LED negative (to the resister ground)
Use any value Resistors to protect the LEDs.

Commands
To enable GPIO 0,1,2s mode to output the singal



To enable GPIO 0's current. (Turn RED led on)

To enable GPIO 1's current. (Turn Yellow led on)

To enable GPIO 2's current. (Turn Green led on)

To disable GPIO 0's current. (Turn RED led off)

To disable GPIO 1's current. (Turn Yellow led off)

To disable GPIO 2's current. (Turn Green led off)


Source: https://projects.drogon.net/raspberry-pi/gpio-examples/tux-crossing/2-two-more-leds/