• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
:::


Browsing this Thread:   1 Anonymous Users






Re: 4*4按鈕擴充 問題...........
#2
版主
版主


查看用戶資訊
4 x 4 的按鍵掃描沒有人這樣寫的。
參考一下 AN557 的中斷掃描程式(組語)。
http://www.microchip.com/stellent/idc ... eId=1824&appnote=en011048

發表於: 2008/11/10 16:50
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


4*4按鈕擴充 問題...........
#1
新會員
新會員


查看用戶資訊
開關方面 其中4接腳接到vcc和 RB0~3 (輸入)
4接腳接到vcc和 RBE~3 (輸出)

問題:
我按 SW0時會出現 0 但他會同時出現 0 4

SW1時會出現1 但他會同時出現 1 5

SW4時會出現4 但他會同時出現 0 4

SW0時會出現5 但他會同時出現1 5

......WHY........

#include <p30F4011.h>
#include "C30EVM_LCD.h"

int main()
{

ADPCFG = 0xffff ;

LATB = 0xffff ;
PORTB = 0xfff0 ;
LATE = 0xffff ;
PORTE = 0xffff ;


OpenLCD( );

while(1)
{
PORTBbits.RB0=0 ;

if (PORTEbits.RE0==0 ) // sw0 動作0
{ setcurLCD(0,0);
putrsLCD( "0" ) ;
while( PORTEbits.RE0==0);
}
if( PORTEbits.RE1==0 ) //sw1 動作1
{ setcurLCD(1,0);
putrsLCD( "1" ) ;
while( PORTEbits.RE1==0);
}
if( PORTEbits.RE2==0 ) //sw2 動作2
{ setcurLCD(2,0);
putrsLCD( "2" ) ;
while(PORTEbits.RE2==0);
}

if( PORTEbits.RE3==0 ) // sw 3動作3
{ setcurLCD(3,0); putrsLCD( "3" ) ;
while( PORTEbits.RE3==0);
}

PORTBbits.RB1=0 ;

if( PORTEbits.RE0==0 ) // sw4動作4
{ setcurLCD(4,0);
putrsLCD( "4" ) ;
while( PORTEbits.RE0==0);
}
if( PORTEbits.RE1==0 ) //sw5 動作5
{ setcurLCD(5,0);
putrsLCD( "5" ) ;
while( PORTEbits.RE1==0);
}
if( PORTEbits.RE2==0 ) //sw6 動作6
{ setcurLCD(6,0); putrsLCD( "6" ) ;
while(PORTEbits.RE2==0);
}

if( PORTEbits.RE3==0 ) // sw7 動作7
{ setcurLCD(7,0); putrsLCD( "7" ) ;
while( PORTEbits.RE3==0);
}

}
}

發表於: 2008/11/10 8:18
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







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.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------