高级会员
- 积分
- 873
- 威望
- 420
- 贡献
- 255
- 兑换币
- 218
- 注册时间
- 2012-11-4
- 在线时间
- 99 小时
- 毕业学校
- 鲁西南大学
|
#include <hidef.h> /* common defines and macros */
#include "derivative.h" /* derivative-specific definitions */
unsigned char Data1[8]={0xFE,0xFD,0xFB,0xF7,0xEF,0xDF,0xBF,0x7F};
void Delay(unsigned int Time)
{
unsigned char i;
for(i=0; i<200; i++)
for( Time=200; Time>0; Time--);
}
void main(void)
{
unsigned char i;
DDRB=0xFF;
while(1)
{
for(i=0;i<8;i++)
{
PORTB=Data1[i];
Delay(50000);
Delay(50000);
}
if(i==8)
{
for(i=7;i>0;i--)
{
PORTB=Data1[i];
Delay(50000);
Delay(50000);
}
}
}
}
新手··初学、共同进步~~ |
|