闪烁灯程序,本人已证明该程序可以在ATtiny13A上正常运行。
#include <avr/io.h>
#define F_CPU 1000000U // 这个我是暂时乱写的晶振大小,我也不知道现在晶振大小是多少!!!!
#include <util/delay.h>
int main()
{
DDRB = 0xff;
PORTB = 0xff;
while (1) {
PORTB = 0xff;
_delay_ms(1000);
PORTB = 0x00;
_delay_ms(1000);
}
}