A SERVICE OF

logo

csTimeSensor
125
Continuing Timer Events
csTimeSensor::loop() takes a boolean value. If it is TRUE, the csTimeSensor continues
to generate events after the completion of one cycle. If the boolean value is FALSE,
csTimeSensor only generates events for a single cycle.
The following two methods are used to get and set the value of loop():
csTimeSensor::getLoop();
csTimeSensor::setLoop();
Cycle Time Event
A csTimeSensor generates a cycleTime event whenever the csTimeSensor begins a new
cycle. cycleTime is an absolute csTime value. If the csTimeSensor runs for only a single
loop, the cycleTime event is only generated at the beginning of the loop.
The current value of cycleTime can be retrieved by calling:
csTimeSensor::getCycleTime();
Fraction Changed Event
A csTimeSensor generates a fractionChanged event on every update while the
csTimeSensor is active. fractionChanged is a oat value in the range [0.0, 1.0] representing
the percentage of the current cycle completed. If the argument of loop() is TRUE, at the
beginning of the rst cycle the value of fractionChanged is 0.0. However, the beginning of
all subsequent cycles generate a value of 1.0. The different value is a result of the
beginning of one cycle coinciding with the end of the previous cycle.
The value of fractionChanged is returned using the following method:
csTimeSensor::getFractionChanged();