51单片机控制八个发光二极管怎么编程答:// 51单片机控制八个发光二极管 左右循环。include<reg52.h> define uchar unsigned char define uint unsigned int unsigned char TAB[]= {0xff,0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f,0xff,0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe,0xff}; // 改变这里 LED 各种花样 uchar t...
用单片机p1口控制8个发光二极管,采用共阳极链接方式,先编程实现下列功能...答:MAIN:MOVp1,#0FEH MOVR7,#0FEH LCALLDELAY MOVA,R7 RLA MOVR7,A MOV80h,A JMPMAIN_LP ;=== DELAY:MOVR0,#0FFH MOVR1,#0FFH DLY_LP:NOP NOP DJNZR0,DLY_LP MOVR0,#0FFH DJNZR1,DLY_LP RET END
用8051单片机控制八个发光二极管,每隔一个灯亮的左循环程序答:;P1口接8个LED.上拉电阻1K ORG 0000H AJMP STARTUP ORG 0030H STARTUP:MOV SP,#60H MOV A,#0AAH LOOP:MOV P1,A ACALL DELAY RLC A SJMP LOOP ;延时的多少决定灯移动速度的快慢 DELAY:MOV R7,#5 DL2:MOV R6,#100 DL1:MOV R5,#100 DJNZ R5,DJNZ R6,DL1 DJNZ R7,DL2 RET END ...