Clear tick – Remote Processing CAMBASIC User Manual

Page 52

Advertising
background image

Comm ands - 19

CLEAR TICK

Tasking Statement

SYNTAX:

CLEA R TICK n

PURPOSE:

To reset the internal TICK clock to zero. This does not affect a calendar/clock or the counter for the
ON T ICK statem ent.

REMARK S:

There are three TICK timers in CAMBASIC. The parameter n is the timer number and the ra nge is
0 to 2. All TIC K timers are independent. This statement can be used as an electronic stop watch. It
can be used in conjunction with the ON BIT statement to measure how long an input is active.

See the Multitasking Chapter for more information.

RELATED:

O N T I C K, T I C K

EXAMPLE:

10 CLEAR TICK 0
20 IF BIT(&18,0) = 1 THEN 20
30 PRINT TICK (0)
RUN
37.20

This example measured the elapsed time for bit 0 of address &18 to go high.

ERROR:

< Data out of range> - if n> 2
< Data negative> - for n

Advertising