看板 ASM 關於我們 聯絡資訊
#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 ::: } } -- 上帝完美無瑕 上帝造人,人有缺陷 人被造得有缺陷,人造之物必然漏洞百出 WolfLord -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 111.246.244.99 ※ 文章網址: https://www.ptt.cc/bbs/ASM/M.1446030804.A.6A7.html ※ 編輯: WolfLord (111.246.244.99), 10/28/2015 20:55:45
mick99988: 嗯.... 可以說明main裡面 pct那段嗎 12/13 23:49