Timer Code Help

Started by mk11174, July 31, 2013, 10:55:36 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mk11174

Hi, I was hoping anyone at all could give me a code example of a ML timer code, msleep just pauses live view if I try to use it, so I am guessing that is not the best option for what I am doing. I am using bolt trigger, and I wanted to add an extra thing to it, I want it to set off a detection every 10 seconds so I can have it capture images for a time lapse while it is waiting for actual bolts. I don't want to take regular pictures, just the RAW buffer captures, so I just want to say something like,

      if(timer==10)
     {
      bolt_raw_recording = 1;
     }
}

But how can I create a simple time code that wont freeze live view like msleep? Anyone that can help I would really be greatful, thanks.
500D/T1i  550D/T2i  600D/T3i  700D/T5i

a1ex

You can check the timer value periodically with get_ms_clock_value.

Or, for your case:

int aux = INT_MIN;
if (should_run_polling_action(10000, &aux)) ...

This call is not blocking, so you can use it from vsync without pausing LiveView.

mk11174

Quote from: a1ex on July 31, 2013, 11:17:52 AM
You can check the timer value periodically with get_ms_clock_value.

Or, for your case:

int aux = INT_MIN;
if (should_run_polling_action(10000, &aux)) ...

This call is not blocking, so you can use it from vsync without pausing LiveView.
OK! Thank you very much!
500D/T1i  550D/T2i  600D/T3i  700D/T5i

mk11174

Hope not asking to much, but I cannot at all get it to loop, it will only go active once, any ideas?

YES!!! Finally figured it out, thanks again Alex!
500D/T1i  550D/T2i  600D/T3i  700D/T5i