单片机C语言中多个延时程序同时使用怎样编写?

[复制链接]
查看11 | 回复3 | 2012-9-8 16:16:23 | 显示全部楼层 |阅读模式
延时子函数 直接调用就行了 这里以一毫秒计算 10秒的话你自己算一下 精确计时就用定时器比较好void delay(unsigned z){
unsigned uint x,y;
for(x=0;x<z;x++)
for(y=0;y<110;y++);}...
回复

使用道具 举报

千问 | 2012-9-8 16:16:23 | 显示全部楼层
int x;bit led1,led2;void intter_0() intterupt 0{
led1 = 1;}void timer0() intterupt 1{++x}void intter_2() intterupt 2{led2 = 1;}void main(...
回复

使用道具 举报

千问 | 2012-9-8 16:16:23 | 显示全部楼层
用定时器,不占用cpu资源...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行