Re: 單 on 雙 off 的開關問題~~(按一下 on 再按一下就 off)
|
||||
---|---|---|---|---|
版主
|
其實C或組合語言寫程式,其流程架構都是一樣的,先研究ㄧ下彈跳處理的流程再轉寫成組合語言。
或著你可以參考市面上有很多有關PIC16F877的中文書多多少少都會寫道如何處理彈跳的問題。
發表於: 2006/10/18 14:37
|
|||
|
Re: 單 on 雙 off 的開關問題~~(按一下 on 再按一下就 off)
|
||||
---|---|---|---|---|
新會員
|
非常感謝板主的解答~~~~~~~~~~~~~~
但我只會用組合語言的寫法....C的寫法 看不懂 真是不好意思,有小範例或者大概要怎麼樣的寫法才可以克服這個問題 謝謝參照:
發表於: 2006/10/17 17:30
|
|||
|
Re: 單 on 雙 off 的開關問題~~(按一下 on 再按一下就 off)
|
||||
---|---|---|---|---|
版主
|
像你這種按鍵竟需考慮按鍵彈跳的問題,模擬下是不會有彈跳的所以很正常,但實際接上硬體就亂了。
底下是用C寫用延遲方式處理彈跳的例子:
void Press_Key(void)
發表於: 2006/10/17 15:33
|
|||
|
單 on 雙 off 的開關問題~~(按一下 on 再按一下就 off)
|
||||
---|---|---|---|---|
新會員
|
麻煩各位先進了~~~
-------------------------------------------------------- 我要做一個單 on 雙 off 的按鍵控制 就是按一下 on 再按一下就 off 單 on 時沒有問題,可是 雙 off 時就沒辦法回去了 ,程式在 MPLAB IDE 上模擬時都很正常. 可是在實際上操作時就不行了 --------------------------------------------------------- 以下是我的程式 right incf right_counter,f movlw b'00000011' andwf right_counter,f btfss right_counter,1 goto right1 goto clearright right1: movlw b'00000111' movwf 06h delaybig movlw b'00111111' movwf 06h delaybig btfsc 05h,3 goto right1 goto right clearright: movlw 00h movwf right_counter movlw b'11111111' movwf 06h goto scan --------------------------------------------------------------------
發表於: 2006/10/16 16:28
|
|||
|