digitalRead isn't working

hey there, my cod doesn’t work does anyone know why?
originally it was made to control an ir-led, but it didn’t work, so i tried to eliminate sources of errors

/*
   IRremote: IRsendDemo - demonstrates sending IR codes with IRsend
   An IR LED must be connected to Arduino PWM pin 3.
   Version 0.1 July, 2009
   Copyright 2009 Ken Shirriff
   http://arcfn.com
*/

//#include <IRremote.h>
int yellow = 5;
int blue = 6;
int i = 0;
int led = 3;
int y = 1;
int b = 1;

//IRsend irsend;

void setup()
{
  //Serial.begin(9600);
  pinMode(yellow, INPUT_PULLUP);
  pinMode(blue, INPUT_PULLUP);
  pinMode(led, OUTPUT);
}

void loop() {
  y = digitalRead(yellow);
  b = digitalRead(blue);

  if (y == 0 /*&& i == 0*/)
  {
    i = 1;
    digitalWrite(led, HIGH);
    delay(1000);
    digitalWrite(led, LOW);
  }

  /*
    irsend.sendSony(0xc90, 12); // Sony volume down code
    delay(40);
  */

  if (b == 0 /*&& i == 1*/)
  {
    digitalWrite(led, HIGH);
    delay(1000);
    digitalWrite(led, LOW);
    i = 2;
  }
  if ( i == 2)
  {
    //   irsend.sendSony(0x490, 12); // Sony volume up code
    //  delay(40);
    digitalWrite(led, HIGH);
    delay(1000);
    digitalWrite(led, LOW);
  }
}

I've no idea why your cod doesn't work - I'm more of a haddock or pollock man myself if we are talking white fish.

You commented out your library

What do you mean with //IRsend irsend; ? Why is it commented out and what is it supposed to do?

You commented out serial begin - did you mean to?

At no point do you make a digitalRead in your code?

There's loads of other bits commented out - why?

(// before anything means that it's a comment for humans, and the arduino just ignores it)

fall-apart-dave:
At no point do you make a digitalRead in your code?

Other than the two at the start of loop()?

A simple way to find out if a read is doing something is to print the value it returns.

Your Title is inappropriate.

My guess is that the digitalRead() function is working perfectly.

The problem (if there is a problem) is that the voltage on the I/O pin it is reading is not varying sufficiently to give a HIGH or LOW - but you have not told us which one it is failing to give.

...R

What is connected to IO pins 5 (yellow) and 6 (blue)?

It would be helpful if you could post a circuit diagram / schematic (NOT Fritzing!) If you don't have a schematic capture program or other CAD, a pencil / pen drawing on paper, scanned or photographed, would do.

Looks like the Yellow pin should light the LED for one seconds wen you ground it and the Blue pin should light the LED for 2 seconds when you ground it. If either pin is left connected to ground the LED will just stay on.

Upon blue becoming low, i is set to 2 and until yellow is made low the LED will remain on (you switch it on for one second, but the next time loop() runs the LED is switched on immediately again).

Also the delay() calls make that your digitalRead() calls are done only once a second when there's an LED to be lit. Or two seconds if blue is LOW. That's very bad for responsiveness and may result in you thinking it doesn't read the pins at all.

AWOL:
Other than the two at the start of loop()?

A simple way to find out if a read is doing something is to print the value it returns.

I can't believe I missed that! Apologies!