Here, I give you this for nothing. What can I say... it works. At least it does what I think Saulius wanted in that other thread.

The sketch waits for the signal at Pin 7 to go from Low to High ( connected to the Output of the LM358n comparator) then it pulses an output for 100 ms (or whatever length of time is desired) then pauses for one second (or whatever) then pulses the output again, and goes back to waiting for another transition from Low to High on the comparator output.
/*---------------------------------------------------------------------------//
simple timer program to work with LM358n comparator circuit
to trigger relay or mosfet when 20 mV signal level is reached
//---------------------------------------------------------------------------*/
int relayOn = 100; // set relay ON time in ms here
int pause = 1000; // set pause in ms between relay actuations here
void setup() {
pinMode (10, OUTPUT); // connect relay driver or mosfet Gate here
pinMode (7, INPUT); // connect Output from comparator here
}
void loop() {
while (digitalRead(7)==LOW) {
// do nothing, wait for signal to go HIGH
}
// when signal goes High, actuate relay for relayOn time
digitalWrite(10, HIGH);
delay(relayOn);
digitalWrite(10, LOW);
delay (pause); // pause
digitalWrite(10, HIGH); // actuate relay again for relayOn time
delay(relayOn);
digitalWrite(10, LOW);
while (digitalRead(7)==HIGH) {
// do nothing, wait for signal to go LOW again to reset cycle
}
}
