
iVIEW-100 Series user’s Manual, 2006, v2.0 ----- 134
StopWatchReadValue()
Func.: Read current StopWatch value.
Syntax:
int StopWatchReadValue(int channel,unsigned long *value);
Header: #include ”iVIEW.h”
Description:
The value stand for the time from call StopWatchStart/StopWatchReset to
now.channel:0-7, total 8 channels
If channel is out of range return ChannelError(-15). If success return NoError.
Example: Please refer to “StopWatchStart ()” for detail information.
CountDownTimerStart()
Func.: Start to use CountDownTimer.
Syntax:
int CountDownTimerStart(int channel,unsigned long count);
Header: #include ”iVIEW.h”
Description:
channel: 0-7, total 8 channels.
count: the count(time) want to be countdown.
If channel is out of range return ChannelError(-15). If success return NoError.
Example:
(codn.c)
#include <iVIEW.h>
#include <mmi100.h>
void main(void)
{ unsigned long value;
int quit=0;
InitLib();
Print("\n\rTest CountDownTimer...");
Print("\n\rPress 'q' to quit\n\r");
TimerOpen();
CountDownTimerStart(0,1000); /*use the CountDownTimer*/
while(!quit){
if(Kbhit()&&(Getch()=='q')) quit=1;
CountDownTimerReadValue(0,&value); /*read CountDownTimer*/
Print("Test CountDown=%d\r",value);
if(value==0)
CountDownTimerStart(0,1000); /*start again CountDownTimer*/
}
TimerClose();
}
CountDownTimerReadValue()
Func.: Read the current value of CountDownTimer(count).
Syntax:
int CountDownTimerReadValue(int channel,unsigned long *value);
Header: #include ”iVIEW.h”
Description:
when the return value is 0, that is the time is up.
channel: 0-7, total 8 channels.
value: a pointer for the value to be stored.
If channel is out of range return ChannelError(-15).
On success return current timer value.
Example: Please refer to “CountDownTimerStart ()” for detail information.