51单片机 流水灯实现10S,10S后流水灯关闭答:include<reg52.h> include<intrins.h> define uchar unsigned char define uint unsigned int sbit dula=P2^6;sbit wela=P2^7;uchar pp,miao=10,aa;uchar code table[]={ 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71,0x00};/*延时函数*...
单片机流水灯设计,从右到左依次亮,刚开始全灭,然后依次亮,最后用bcd...答:include<reg51.h> define uchar unsigned char uchar led[]={0xff;0xfe,0xfc,0xf8,0xf0,0xe0,0xc0,0x80,0x00,0x16};void delay(int a){ uchar i;while(a--)for(i=0;i<120;i++);} main(){ uchar i;while(1){ P0=led[i];delay(500);i++;i%=10;} } ...
51单片机,要求是让流水灯正常运行,要求是数码管显示学号流水灯运行,然 ...答:include "AT89X52.h"#include "intrins.h"define LEG_LINE P2#define LEG_DUAN P0 sbit Button = P3^7;unsigned long dispalyCount;unsigned int mCount;unsigned char table[] = {0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x8e};void ...
...流水灯,灯从右到左依次亮,延迟2s,谁能给个程序呀,用汇编语言...答:ORG 00H JMP MAIN ORG 30H MAIN:MOVA,#0FFH;设置左移初值 CLRC;C=0 MOVR2,#08H;设置左移次数 LOOP:RLCA;左移1位 MOVP2,A;输出到P2 CALLDELAY;延时 DJNZR2,LOOP;左移7次 MOVR2,#07H;LOOP1:RRCA;右移1位 MOVP2,A;输出到P2 CALLDELAY;DJNZR2,LOOP1;右移7次 JMPMAIN DELAY:MOVR3,#...