#include <mega88.h> void delay() { unsigned char j = 200; while(j--); }
void main(void) { unsigned char i;
DDRB = 0xFF; PORTB = 0xFF; DDRC = 0x00; PORTC = 0xFF; DDRD = 0xFF; PORTD = 0xFF;
TCCR0A=0x83; // 1000 0011 TCCR0B=0x09; // 0000 1001 TCNT0=0; while (1) { i = 255; while (i) { OCR0A = i; delay(); i --; } i = 1; while (i) { OCR0A = i; delay(); i ++; } } } 为什么mega88的OC0A引脚没有反应呢??
程序哪里出了问题,是初始化错了吗??
麻烦高手帮忙
|