一个花样流水灯单片机程序(要求1,3,5,7灯亮,2,4,6,8灯亮然后全灭)答:先把P1口全部接低电平。ORG 0000H。AJMP START。ORG 0040H。AA:MOV P1,#55H。ACALL DELAY。MOV P1,#0AAH。ACALL DELAY。MOV P1,#00H。ACALL DELAY。AJMP AA。DELAY:MOV R5,#256。LOOP2:MOV R4,#256。LOOP1:NOP。NOP。DJNZ R4,LOOP1。DJNZ R5,LOOP2。RET。单片机(Single-Chip ...
51 单片机一个左右同时向中间流动的流水灯,keil编译通过,就是实现不了...答://上面这段改完也不是两边同时向中间流水,只是左到右,左到右的来回流水灯 两边向中间流水,直接用查表法,//11111111B, 01111110B, 10111101B, 11011011B, 11100111B uchar MB[]={0xFF, 0x7E, 0xBD, 0xDB, 0xE7};uchar i=0;while(1){ P1 = MB[i++];if(i>=5) i=0;delayms(...
单片机流水灯改程序实现间隔跳着亮倒着顺序亮,来个大神帮帮忙_百度知 ...答:include<reg51.h>void delay(){int i,j;for(i=0;i<250;i++)for(j=0;j<150;j++);}code unsigned char tzl[]={0xfe,0xfb,0xef,0xbf};//跳着亮code unsigned char dzsxl[]={0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe};//倒着顺序亮void led(unsigned char *p,unsigned ...