#include<iom8v.h>
#include<macros.h>
#define uchar unsigned char
#define uint unsigned int
void DelayMs(uint i);
uchar dis[] = {0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
int main(void)
{
uchar i;
uchar* p;
DDRB = 0XFF;
while(1)
{
P = &dis[0];
for(i = 0;i < 8;i++)
{
PORTB = * p;
p++;
DelayMs(100);
}
}
}
void DelayMs(uint i)
{
uint j;
for(;i != 0;i--)
{
for(j =1000;j!= 0;j--);
}
} |