找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 2796|回复: 2
收起左侧

adc0808与单片机控制led路灯的程序不知对错

[复制链接]
ID:203520 发表于 2017-5-22 16:29 | 显示全部楼层 |阅读模式
出现光敏电阻值得变化控制不了led灯的亮灭程序如下
#include<reg52.h>
#define uchar unsigned char
#define uint unsigned int
sbit clock=P2^4;
sbit start=P2^5;                       
sbit boc=P2^6;
sbit oe=P2^7;
sbit shuchu=P3^0;
uchar temp;
yanshi(uint z)                       
{
uint x,y;
for(x=z;x>0;x--)
for(y=110;y>0;y--);
}

void main()                               
{       
start =0;                               
clock=0;
yanshi(40);
boc=1;               
yanshi(70);       
boc=0;               
P1=0xff;       
temp=P1;                               
if(temp<128)
shuchu=0;         
else
shuchu=1;         
}

uu.png
回复

使用道具 举报

ID:203520 发表于 2017-5-23 19:51 | 显示全部楼层
大神门帮看一下呗
回复

使用道具 举报

ID:203520 发表于 2017-5-23 19:52 | 显示全部楼层
大神们给看看白
回复

使用道具 举报

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

本版积分规则

小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表