iniuxy的MCU DIY进程贴-高清美图 仅此一家

最简单的跑马灯
#include<reg52.h>
#include<intrins.h>
#define uchar unsigned char
#define uint unsigned int
void delay_ms(uint s)
{
uint x;
for(s;s>0;s--)
{
for(x=100;x>0;x--);
}
}
void main()
{
uchar i, j;
P1 = 0xFF;
while(1)
{
P1 = 0x7F;
delay_ms(100);
for(i = 0; i < 8; i++)
{
P1=_cror_(P1,1);
delay_ms(100);
}
}
}
#include<reg52.h>
#include<intrins.h>
#define uchar unsigned char
#define uint unsigned int
void delay_ms(uint s)
{
uint x;
for(s;s>0;s--)
{
for(x=100;x>0;x--);
}
}
void main()
{
uchar i, j;
P1 = 0xFF;
while(1)
{
P1 = 0x7F;
delay_ms(100);
for(i = 0; i < 8; i++)
{
P1=_cror_(P1,1);
delay_ms(100);
}
}
}
回复
打赏帖 | |
---|---|
【Zephyr】使用Zephyr外设初始化过程解析被打赏30分 | |
【S32K146】S32DS watchdog 配置使用被打赏20分 | |
【Zephyr】使用 IAR 调试 Zephyr 镜像被打赏20分 | |
赚取电动螺丝刀+电源电路理论知识分享1被打赏5分 | |
我想要一部加热台+分享常见运算放大器电路的应用被打赏5分 | |
【Zephyr】MCXN947 Zephyr 开发入门适配shell被打赏20分 | |
我想要一部加热台+常见的MOS管驱动电路被打赏5分 | |
【我要开发板】6.联合MATLAB记录数据被打赏50分 | |
【换取手持数字示波器】MicrochipMPLABHarmony框架下串口调试printf输出记录被打赏29分 | |
【瑞萨RA2E1开发板】:使用ADC功能实现位移传感器采集方案被打赏20分 |