Need some help, brand new to arduino and programming

As the title says I am brand new to this and I am attempting to control 3 leds with 3 buttons. I have a picture of my breadboard set up and the program is as follows:

int LEDRED = 12;
int LEDYEL = 11;
int LEDGRN = 10;

int BUTRED = 2;
int BUTYEL = 3;
int BUTGRN = 4;

void setup()
{
pinMode(LEDRED,OUTPUT);
pinMode(LEDYEL,OUTPUT);
pinMode(LEDGRN,OUTPUT);

pinMode(BUTRED,INPUT);
pinMode(BUTYEL,INPUT);
pinMode(BUTGRN,OUTPUT);
}

void loop() {
if(digitalRead(BUTRED) == HIGH)
{
digitalWrite(LEDRED,HIGH);
}else
{
digitalWrite(LEDRED,LOW);
}

if(digitalRead(BUTYEL)==HIGH)
{
digitalWrite(LEDYEL,HIGH);
}else
{
digitalWrite(LEDYEL,LOW);
}

if(digitalRead(BUTGRN)==HIGH)
{
digitalWrite(LEDGRN,HIGH);
}else
{
digitalWrite(LEDGRN,LOW);
}}

The program ran but I can’t get the green to light up with the button. Any help is very much appreciated. Again I am new to this so please be kind.

pinMode(BUTGRN,OUTPUT); BUTGRN should be INPUT here

 if(digitalRead(BUTRED) == HIGH)
 {
   digitalWrite(LEDRED,HIGH);
 }else
 {
   digitalWrite(LEDRED,LOW);
 }

Is much more simply written digitalWrite (LEDRED, digitalRead (BUTRED));

Hi, I notice that you also have one of the protoboards where the blue and red lines down the sides are broken in the middle. This means the conductor strip under them that runs the length is also open at the break. You will not have continuity from one end to the other of the power supply lines.

So your left hand button in your picture will not work as it is not connected to 5V or gnd. Nor will the left hand LED.

Tom.... :)

Now if you are looking to improve your code, (ps: please use [code]code tags[/code]), rather than switching your LEDs when the button is up/down, switch them when the button changes from up to down.

int LEDRED = 12;
int LEDYEL = 11;
int LEDGRN = 10;

int BUTRED = 2;
int BUTYEL = 3;
int BUTGRN = 4;

boolean butRedDown = false;
boolean butYelDown = false;
boolean butGrnDown = false;

void setup()
{
  pinMode(LEDRED, OUTPUT);
  pinMode(LEDYEL, OUTPUT);
  pinMode(LEDGRN, OUTPUT);

  pinMode(BUTRED, INPUT);
  pinMode(BUTYEL, INPUT);
  pinMode(BUTGRN, INPUT);
}

void loop() {
  boolean new_butRedDown = (digitalRead(BUTRED) == HIGH);

  if (new_butRedDown != butRedDown)
  {
    if (new_butRedDown)
    {
      digitalWrite(LEDRED, HIGH);
    }
    else
    {
      digitalWrite(LEDRED, LOW);
    }
    butRedDown = new_butRedDown;
  }

  // etc

}

and the thing to do after that is to put al that repeated code into a function:

int LEDRED = 12;
int LEDYEL = 11;
int LEDGRN = 10;

int BUTRED = 2;
int BUTYEL = 3;
int BUTGRN = 4;

boolean butRedDown = false;
boolean butYelDown = false;
boolean butGrnDown = false;

void setup()
{
  pinMode(LEDRED, OUTPUT);
  pinMode(LEDYEL, OUTPUT);
  pinMode(LEDGRN, OUTPUT);

  pinMode(BUTRED, INPUT);
  pinMode(BUTYEL, INPUT);
  pinMode(BUTGRN, INPUT);
}

void loop() {
  handleButton(BUTRED, LEDRED, butRedDown);
  handleButton(BUTYEL, LEDYEL, butYelDown);
  handleButton(BUTGRN, LEDGRN, butGrnDown);
}

void handleButton(int button, int led, boolean &isdown) {
  boolean new_isdown = (digitalRead(button) == HIGH);

  if (new_isdown != isdown)
  {
    if (new_isdown)
    {
      digitalWrite(led, HIGH);
    }
    else
    {
      digitalWrite(led, LOW);
    }
    isdown = new_isdown;
  }
}

Then we can pull the buttons, their switches, and their current state into a struct. We don’t really need the function anymore.

struct button {
  int led;
  int button;
  int isdown;
};

const int NUMBUTTONS = 3;

struct button buttons[NUMBUTTONS] = {
  {12, 2, false}, // red
  {11, 3, false}, // yellow
  {10, 4, false} // green
};

void setup() {
  for (int i = 0; i < NUMBUTTONS; i++) {
    pinMode(buttons[i].led, OUTPUT);
    pinMode(buttons[i].button, INPUT);
  }
}

void loop() {
  for (int i = 0; i < NUMBUTTONS; i++) {
    boolean new_isdown = (digitalRead(buttons[i].button) == HIGH);

    if (new_isdown != buttons[i].isdown) {
      if (new_isdown) {
        digitalWrite(buttons[i].led, HIGH);
      }
      else {
        digitalWrite(buttons[i].led, LOW);
      }
      buttons[i].isdown = new_isdown;
    }
  }
}

Damn man, how long have you guys been doing programming? And is there a good resource for gaining this knowledge. something that explains what everything means and not just what to write to do something - mine has been youtube mostly. Thanks for the tips to clean up and simplify my text (unfortunately I have no clue what any of that means or does, just words on a screen).

Tom - That would do it, thank you.

Thanks again guys (no offense if there are any women that helped, just a saying), and I am sure that I will be utilizing your knowledge again soon. I am getting into this to make a specific device (or many devices) for my job (Occupational Therapist).

Have a day

Hi, Good to hear you got it going, OC therapist is good application. Check these guys out.

http://forum.arduino.cc/index.php?topic=317892.0

Tom.... :)