#include <REGX52.H>
void Delay1ms(unsigned int count)
{
unsigned int i,j;
for(i=0;i<count;i++)
for(j=0;j<0;j++);
}
main()
{
unsigned char LEDIndex = 0;
bit LEDDirection = 1;
while(1)
{
if(LEDDirection)
P2 = ~(0x01<<LEDIndex);
else
P0 = ~(0x80>>LEDIndex);
if(LEDIndex==7)
LEDDirection = !LEDDirection;
LEDIndex = (LEDIndex+1)%8;
Delay1ms(1000);
}
}
单片机仿真 流水灯.rar
版权申诉
176 浏览量
2023-04-12
07:55:56
上传
评论
收藏 54KB RAR 举报
荣华富贵8
- 粉丝: 166
- 资源: 7654
最新资源
- python-leetcode面试题解之第421题数组中两个数的最大异或值.zip
- python-leetcode面试题解之第416题分割等和子集.zip
- python-leetcode面试题解之第414题第三大的数.zip
- python-leetcode面试题解之第412题Fizz-Buzz.zip
- python-leetcode面试题解之第409题最长回文串.zip
- python-leetcode面试题解之第408题有效单词缩写.zip
- python-leetcode面试题解之第405题数字转换为十六进制数.zip
- python-leetcode面试题解之第404题左叶子之和.zip
- python-leetcode面试题解之第401题二进制手表.zip
- python-leetcode面试题解之第400题第N位数字.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈