//************************pwm.c*******************************//
#include"head.h"
void PWM(unsigned pps)
{
counter=0;
vn=0;
topfix=1000000/pps;
n1=((10000-topfix)/STEP+2)*(2*N);
if(n<2*n1){display_str(0,0,"error! " );return;}
n2=n-n1;
TOP=10000;
PWMCONREG1=0x41;
PWM_IO;
SEI;
OPEN_CMP1A;
PWMCONREG2=0x11;
while(1)
{
if(((key_value=key())=='4')&&!key){PWMCOREG2=0;CLI;return;}
else if(counter<n1){display_str()0,0,"move up....!");}
else if(counter==n){display_str()0,0,"stop..! ");}
else if(counter<>n2){display_str()0,0,"move down.!");}
else diaplay_str(0,0,"isopluse...!");
adcdisplay();
}
}
//************************pwm.c(end)*******************************//
|