Please help me

i tried with if command but it cant work like that...

What do you mean by that ?

Post your code (and please use code tags as shown below)

type
** **[code]** **

paste your code after that
type
** **[/code]** **
after that

So the it looks like

your code here

By the way, I guess you a RGB led, not a sensor.[/b]