#include<pic.h>
#define uint unsigned int
#define uchar unsigned char
__CONPIG1(0xf831);
//uint n;
void pwminit();
//void delay();
void main()
{
void pwminit();
TRISC1=0;
TRISC2=0;
while(1)
{
;
}
}
void pwminit()
{
TRISC1=1;
TRISC2=1;
RC2=0;
PR2=78;
CCP1CON=0x0f;
CCPR1L=0X27;
TMR2IF=0;
T2CON=4;
GIE=0;
TMR2IE=1;
PEIE=1;
TMR2ON=1;
}
此帖出自
小平头技术问答
一周热门 更多>