|
此帖出自嵌入式系统论坛
最新回复
这就流水灯了,就这么简单
#include
#include
#define uint unsigned int
#define uchar unsigned char
uchar aa;
void delayms(uint xms);
void main()
{
aa=0xfe; //赋初值11111110;
while(1)
{
P2=aa; //先点亮一个LED灯
delayms(500); //延时500毫秒
aa=_crol_(aa,1); //将aa循环左移1位后再赋给aa
}
}
void delayms(uint xms) //延时函数
{
uint i,j;
for(i=xms;i>0;i--)
for(j=110;j>0;j--);
详情
回复
发表于 2010-5-22 22:22
| ||
|
||
此帖出自嵌入式系统论坛
| ||
|
||
此帖出自嵌入式系统论坛
| ||
|
||
此帖出自嵌入式系统论坛
| ||
|
||
| |
|
|
| |
|
|
此帖出自嵌入式系统论坛
| ||
|
||
此帖出自嵌入式系统论坛
| ||
|
||
| |
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
此帖出自嵌入式系统论坛
| ||
|
||
| |
|
|
EEWorld Datasheet 技术支持