PIR Timing for a "Light On" for 30 sec

Stuck once again and any suggestions are valued and needed.. I am trying to use a PIR to detect motion and kick a light on for around 30 sec. (I am also using a relay) The problem is I don't want to use the delay() because i also have a temp sensor on a fan and don't want the entire code to delay.

All the code I have found for timing is pretty lengthy and I am having trouble understanding it... I am pretty new at this...

Anyone have any sugestions for how to code in a timing feature?

Does this help: http://www.arduino.cc/playground/Code/Timer1

Create a 30s timer, and when it overflows use a flag to sinalize the pir detector to stop working, something:

loop(){ if(time_is_less_than_30s){ do_pir_stuff) do_the_rest_of_the_program }

When your timer overflows you just put the flag to false and the program keeps working.

don't want the entire code to delay

Have you looked at the "blink-without-delay" tutorial? There is a simple example of performing a timed event without the use of "delay".