Re: [问题] 想问关于89S52去控制伺服马达相关问题

楼主: WolfLord (呆呆小狼￾ ￾ N￾ ￾ )   2015-10-28 19:13:13
#define Outp P1
unsigned char ctc[8];//PWM Main counter
unsigned char pct[8];//PWM Duty vars
void timer_isr(void){//Using 8bit reload to define base freq
unsigned char p,i;
p=0;
for(i=0;i<8;i++){
p>>=1;
ctc[i]++;
if(ctc[i]>pct[8]){p&=0x7f;}else{p|=0x80;}
}
Outp=p;
TF?=0;
}
void main(void){
while(1){
:::
pct{?]=???;//AdjPWM Vars
:::
}
}
作者: mick99988 (高雄人)   2015-12-13 23:49:00
嗯.... 可以说明main里面 pct那段吗

Links booklink

Contact Us: admin [ a t ] ucptt.com