用心讨教问题,看了不要路过呀,进来看看#include <reg52.h>#define uchar unsigned char#define uint unsigned int
uchar segment[]={0xc0,0Xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0xff,0x89,0xc7}; //数码管的段选uchar display_temp[4]={0,0,0,0}; //用来装显示数据的空数组uchar digit_select_line[]={0xef,0xdf,0xbf,0x7f};uint time_count;uint carry_count,pulse_count;uchar flag;
sbit shurua = P2^0; //输入端Asbit shurub = P2^1; //输入端Bsbit shuchu= P2^2; //输出段
求:如果shurua和shurub都没有输入信号(0)时,shuchu无输出(0),当shurua为1时,shuchu输出1,三秒后shurub没有输入1,则shuchu关闭输出(0)只有当shurua和shurub在三秒前都有输入(1)时,shuchu输出(1)
南来的,北往的,哥哥,姐姐,都来帮帮俺吧,给你洗脚了,
[ 本帖最后由 用心思考 于 2012-5-28 06:21 编辑 ]
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
case 0:
break;
case 1:
break;
case 2:
break;
case 3:
break;
.....
}
你画个逻辑添上
{
if((shurua == 0)&&(shurub == 0))
{
shuchu = 0;
}
if(shurua = 1)
{
shuchu = 1;
Dly3ms();
if(shurub !=1)
{
shuchu = 0;
}
}
if((shurua == 1)&&(shurub == 1))
{
Dly3ms();
shuchu = 1;
}
}
一周热门 更多>