Browsing this Thread:
1 Anonymous Users
|
TIMER 和 中斷的問題(dsPIC33FJ256GP710)
|
|
新會員
Joined
: 2008/4/3 11:52 最後登入時間
: 2008/10/20 9:45
Group:
註冊會員
Level : 2 HP : 0 / 28 MP : 3 / 1360 EXP : 12
|
我是個新手~~ 之前老師已經讓我們打出一個程式 按鍵控制跑馬燈~ 版子上的SW4為跑馬燈由右至左做左移 SW5為跑馬燈由左至右做右移 SW6為跑馬燈由中間一個一個移出去 SW3為暫停按鍵 這個程式我是有順利寫出來~ 不過現在學長要求我們延遲的DELAY用TIMER來寫 而暫停按鈕改用中斷來寫 看了書本很久~一直沒有頭緒要怎麼修改成學長要的 我本來的DELAY是用回圏來達成的 void DelayX1ms(unsigned int count) unsigned int i,j; for(i=0;i<count;i++) for(j=0;j<114;j++); } 而我的按停按鈕是用判斷按鍵是否有被按下~有的話就進入無窮迴圈~直到按鍵在被按下才跳出~以下的程式 if (!SW3) do { y=y++; DelayX1ms(800); }while(SW3==1); 請問大大我的DELAY改TIMER 還有暫停用中斷該如何下手才好~~~
發表於: 2008/6/2 18:17
|
|
You can view topic.
你 不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.