閃爍燈程序,本人已證明該程序可以在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);
}
}