How to set function update period
- Eric282000
- Offline
- New Member
Less
More
- Posts: 10
- Thank you received: 3
07 Apr 2016 12:40 #72906
by Eric282000
How to set function update period was created by Eric282000
This is from the hal componet documentation.
function NAME. The function includes a parameter period which is the integer number of nanoseconds between calls to the function.
How would I use the period parameter to make the function only update once per second?
I would like to run the component under the servo - thread but have one of the functions called one per second.
Thanks
function NAME. The function includes a parameter period which is the integer number of nanoseconds between calls to the function.
How would I use the period parameter to make the function only update once per second?
I would like to run the component under the servo - thread but have one of the functions called one per second.
Thanks
Please Log in or Create an account to join the conversation.
07 Apr 2016 12:43 #72908
by andypugh
Replied by andypugh on topic How to set function update period
accum += period
if accum >= 1000000000 {
accum = 0
do_stuff
}
if accum >= 1000000000 {
accum = 0
do_stuff
}
The following user(s) said Thank You: Eric282000
Please Log in or Create an account to join the conversation.
Time to create page: 0.060 seconds