sir it doesnt work because
the led is high only when IRbutton is detected....
Lets see you non working code based on Bert's advice.