LED1->LED2->LED3

sorry, i am new member here =(
i got problem with arduino code =(
can u help me to make source code about this situation?? =(

  1. when i push the pushbutton, LED1 is ON and LED2&3 OFF
  2. then 1 push again the pushbutton, LED2 is ON and LED1&3 OFF
  3. when i push again the pushbutton, LED3 is ON and LED1&2 OFF
  4. when i push again, back to LED1 ON and LED2&3 OFF

=============================
pushbutton on pin 5
LED1-LED3 on PIN 1 until 3

thanks before
and sorry my english so badly
i am from indonesia =(

Muchtar_Luthfi:
LED1-LED3 on PIN 1 until 3

Don't use Pin 1 unless you are out of other options. Pin 1 and Pin 0 are the Serial I/O pins and are useful for debugging.

Start with a debounce example to clean up the button pushes:

/// constants won't change. They're used here to set pin numbers:
const int buttonPin = 5;     // the number of the pushbutton pin
const int led1Pin =  2;      // the number of the LED1 pin
const int led2Pin =  3;      // the number of the LED2 pin
const int led3Pin =  4;      // the number of the LED3 pin

// Variables will change:
int ledState = 0;            // the current state of the LEDs
int buttonState;             // the latest stable state of the input pin

void setup() {
  pinMode(buttonPin, INPUT_PULLUP);
  pinMode(led1Pin, OUTPUT);
  pinMode(led2Pin, OUTPUT);
  pinMode(led3Pin, OUTPUT);
}

void loop()
{
  static int lastButtonState = LOW;   // the previous reading from the input pin
  // the following variables are long's because the time, measured in miliseconds,
  // will quickly become a bigger number than can be stored in an int.
  static unsigned long lastDebounceTime = 0;  // the last time the output pin was toggled
  const unsigned long debounceDelay = 50;    // the debounce time; increase if the output flickers

  int currentButtonState = digitalRead(buttonPin);
  if (currentButtonState != lastButtonState) {
    lastDebounceTime = millis();
    lastButtonState = currentButtonState;
  }

  if ((millis() - lastDebounceTime) > debounceDelay && 
    currentButtonState != buttonState) {
    // We have a new and different stable button state   
    buttonState = currentButtonState;
    if (buttonState == LOW) {
      // The new state is "Pressed"
      ledState++;
      if (ledState > 3)
        ledState = 1;  // After 3, go back to 1

        if (ledState == 1) {
        digitalWrite(led1Pin, HIGH);
        digitalWrite(led2Pin, LOW);
        digitalWrite(led3Pin, LOW);
      }

      if (ledState == 2) {
        digitalWrite(led1Pin, LOW);
        digitalWrite(led2Pin, HIGH);
        digitalWrite(led3Pin, LOW);
      }

      if (ledState == 3) {
        digitalWrite(led1Pin, LOW);
        digitalWrite(led2Pin, LOW);
        digitalWrite(led3Pin, HIGH);
      }

    }
  }
}