timing within a loop

Looks like.

Having said that

Code:

if(count == 1) count =0; // resetting the count

Why check count? You can unconditionally set it zero (either it was already zero, or it's one and you want it to be zero)

Also, given that count can only take two values, shouldn't it be a boolean?

honestly i havent got a clue show me what you mean

I don't understand, was there a question?

yes sorry finding it hard to explain basically when the switch is turned off theres to be a delay before the LED goes off but the delay depends on how long the input was high for so if the button was on for 10s the light will stop on after the button goes low for 10s
but the delay rime can only go upto 30s
i hope ive worded that a bit better

thanks all for your help