Dear Amine,
If you only need certain delay between the sampling you could try using a timer to do it. Maybe the FlexTimer examples could help with it.
Also the using the PDB module could be a good option for it.
You can find examples for this two modules in the SDK.
I hope this helps you.
Best Regards,
Alexis Andalon