标题: 红外测距模块检测(检测好坏的程序) [打印本页]

作者: nius    时间: 2015-4-10 02:35
标题: 红外测距模块检测(检测好坏的程序)
电流方向是重点
电流方向是从单片机流入红外测距模块的
如果程序写成aa=0,则模块不起作用,因为这是想让模块的电流流入单片机

#include<reg51.h>
sbit aa=P1^0;
void main()
{
aa=1;
while(1)
        {
        if(aa==0)
                {
                P3=0xff;
                }
        if(aa==1)
                {
                 P3=0x00;
                }
        }
}







欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1