Function: Inserts a delay for a specific time interval. The time unit is
0.01 ms and uses the Timer 1 of the CPU.
Syntax:
void Delay_2(unsigned ms);
Header: #include
”7188xb.h”
Description: Inserts a delay for a specific time interval. The time unit
is 0.01 ms and uses the Timer 1 feature of the CPU.
ms: the delay time.
Example: Please refer to “TimerOpen()” function for more detailed
information.
StopWatchStart()
Function: Starts using a StopWatch channel, and resets the
StopWatch value to 0.
Syntax:
int StopWatchStart(int channel);
Header: #include
”7188xb.h”
Description: The system timer ISR will increment the StopWatch
value by 1 in 1 ms intervals.
channel: 0-7, a total of 8 channels.
Return Value: On success, returns NoError.
If the channel is out of range, returns ChannelError
(-15).
Example:
#include “7188xb.h”
void main(void)
{
unsigned long value;
int quit=0; InitLib();
Print("\n\rTest the StopWatch ... Press 'q' to quit\n\r ");
TimerOpen();
StopWatchStart(0); /*start using the StopWatchStart function*/
while(!quit){
if(Kbhit()){ switch(Getch()){ case 'q': quit=1; break; } }
StopWatchReadValue(0,&value);
Print("SWatch=%d \r",value);
if(value==2000){
StopWatchPause(0);
DelayMs(2000);
StopWatchContinue(0); }
if(value==4000){
StopWatchStop(0);
I-7188XB Series User’s Manual(Ver.1.0, Apr/2007,
7MH-020-10
) ---
122
Summary of Contents for I-7188XB Series
Page 88: ...I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 88...
Page 138: ...I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 138...
Page 144: ...Step 8 Make the project I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 144...
Page 151: ...Step 8 Rebuild the project I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 151...