#include
#include “derivative.h” /* derivative-specific definitions */
/*********************************************************
//功用: 读取PORTA口拨码开关状况,经过portb 口的LED灯显现
//This is the thirdprogramof mine
//已经过硬件验证;
//Date: 2013/4/13
*********************************************************/
void main(void) {
unsigned char sw_value; //界说变量,记载拨码开关设置值
DDRA = 0X00; //界说A口为输进口
DDRB = 0XFF; //界说B口为输出口
while(1){
sw_value = PORTA;
PORTB = sw_value;
}
}