$ 0 0 look into the blink without using delay example [www.arduino.cc] wrap this delay around your function.