我的程序是:
void main(void) {
/* put your own code here */
//EnableInterrupts;
byte test ;
DDRB = 0xff; // PTB as output
DDRA = 0x00; //PTB as input
cDelay(1000); //延时
cDelay(1000); //延时
for(;;){
test = PORTA; // read can address //
if((test & 0x01)==0x01){
PORTB_BIT4 = 1;
}else{
PORTB_BIT4 = 0;
}
}
}
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |