#include "HT66FU50.h"
#define LED_PORT _pa
#define LED_PORTC _pac
void init(void)
{
_tmpc0 = 0; <span style="white-space:pre"> </span>
_tmpc1 = 0;
_acerl = 0; <span style="white-space:pre"> </span>
_cp0c = 0; <span style="white-space:pre"> </span>
_cp1c = 0;
LED_PORT = 0xff; //0b11111111;
LED_PORTC = 0x00; //0b00000000;
}
void delaynms(unsigned int t)
{
while (t > 0) {
_delay(1000); //1ms
t--;
}
}
int main()
{
unsigned char i;
unsigned int j;
init();
while(1) {
for (i=0; i<8; i++) {
LED_PORT = 0x01<<i;
delaynms(1000);
}
for (i=0; i<8; i++) {
LED_PORT = 0x80>>i;
delaynms(1000);
}
}
return 0;
}