Need to add smal pioece of code to read GPIO for every Half second code, any timer I can invoke from task to read fro every Half-second?.
appreciated.
Solved! Go to Solution.
For interval of half a second, 32-bit timer needs to be used.
Alternatively, you can count the OS ticks (the default is 50 ms).
Thanks, can I crwate a separate task for this, in main function in for loop, can I use tk_sleep for Half second, that way, task collects data for every Half second.
task_main_fn()
{
for(; {
collect GPIO data and do process....
tk_sleep(half-second);
}
}
Hi Yevgeni:
I have to take 840 samples per second, if I keep for loop for 840 then if I keep tk_sleep, not sure when it finishes, for example I have to measure 24 receptacles instantaneous current and voltage for 840 samples per second, is there any way I can measure makesure 840 samples can take within one second, can I use times to happen 840 samples per second exactly without putting task in sleep using tk_sleep?
let discuss sampling the analog values in the separate thread.
Coukd you, please, open the new thread with the descriptive name?
Yes yevgenit, I opened another thread "Sampling of Analog values". Please take a look.
thanks.