******************************************************************************************************
#include
#include
unsigned char led_status = 0xfe;
void initial_avr();
void main(void)
{
initial_avr();
while (1)
{
led_status<<=1;
delay_ms(1000);
led_status |=1;
if(led_status==0xff) led_status=0xfe;
PORTB=led_status;
};
}
void initial_avr()
{
PORTA=0x00;
DDRA=0x00;
PORTB=0xFF;
DDRB=0xFF;
PORTC=0x00;
DDRC=0x00;
PORTD=0x00;
DDRD=0x00;
PORTE=0x00;
DDRE=0x00;
TCCR0=0x00;
TCNT0=0x00;
OCR0=0x00;
TCCR1A=0x00;
TCCR1B=0x00;
TCNT1H=0x00;
TCNT1L=0x00;
OCR1AH=0x00;
OCR1AL=0x00;
OCR1BH=0x00;
OCR1BL=0x00;
GICR|=0x00;
MCUCR=0x00;
EMCUCR=0x00;
TIMSK=0x00;
A¡¦(»ý·«)
|