Author Topic: TICK_COUNT ...why?  (Read 2368 times)

0 Members and 1 Guest are viewing this topic.

Offline tmoney68Topic starter

  • Jr. Member
  • **
  • Posts: 35
  • Helpful? 1
TICK_COUNT ...why?
« on: August 13, 2010, 01:46:40 PM »
OK, been making some nice progress in my 'learning curve' but now have a question .... probably noob-ish, but still.

Why is TICK_COUNT used in appControl and appInitSoftware? I see it used in every snippet from Webbot and Admin, but don't understand why unless its hidden in the function call.  I've never used it when using the standard Setup() and Main() before. Is this specific to webbotlib?

Thanks for your patience in answering this.

Offline Razor Concepts

  • Supreme Robot
  • *****
  • Posts: 1,856
  • Helpful? 53
    • RazorConcepts
Re: TICK_COUNT ...why?
« Reply #1 on: August 13, 2010, 02:03:50 PM »
It's basically the main system time - when you schedule a function to run at a certain interval, the way the program knows when to execute it is through tracking the tick count. It is automatically incremented by a timer.

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: TICK_COUNT ...why?
« Reply #2 on: August 13, 2010, 07:14:40 PM »
The TICK_COUNT (which is like a time of day in uS) is used in a number of ways:-

1. It can be a returned value - and this represents the 'delay' upon exit of the routine. ie if your appControl returns 10,000 then your appControl will be called every 10,000uS ie every 10ms

2. A TICK_COUNT is also passed into the functions to represent the time of day to save you having to call clockGetus.

Note that by 'time of day' I mean 'time since switched on'
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline tmoney68Topic starter

  • Jr. Member
  • **
  • Posts: 35
  • Helpful? 1
Re: TICK_COUNT ...why?
« Reply #3 on: August 14, 2010, 01:45:21 AM »
Thanks guys. I figured it was a timing thing, just wasn't sure why it was utilised where setup() an main() would normally be