51单片机花样流水灯程序

我想要花样的流水灯图案和源码,可是百度和淘宝没找到,你们有资源嘛?或者途径。谢谢你
傻傻的海鸥
浏览 2068回答 2
2回答

如果没有如果5

#include<reg51.h> void main () {P0=0xaf; delay(); P1=0xaf; delay();} delay() {int a=5000; while(a--);}

慕少4109766

#include<reg52.h> #define        uint        unsigned int #define        uchar        unsigned char uchar code table0[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};//LED从低位往高位移 uchar code table1[]={0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe};//LED从高位往低位移 uchar code table2[]={0xfe,0xfc,0xf8,0xf0,0xe0,0xc0,0x80,0x00};//LED从1个亮到8个都点亮(从低位往高位) uchar code table3[]={0x7f,0x3f,0x1f,0x0f,0x07,0x03,0x01,0x00};//LED从1个亮到8个都点亮(从高位往低位) uchar code table4[]={0x00,0x01,0x03,0x07,0x0f,0x1f,0x3f,0x7f,0xff};//LED从8个全亮到一个都不亮(从低位往高位) uchar code table5[]={0x00,0x80,0xc0,0xe0,0xf0,0xf8,0xfc,0xfe,0xff};//LED从8个全亮到一个都不亮(从高位往低位) uchar code table6[]={0xfe,0xfc,0xfa,0xf6,0xee,0xde,0xbe,0x7e};//LED从低位往高位移(最低位始终为0) uchar code table7[]={0x7f,0x3f,0x5f,0x6f,0x77,0x7b,0x7d,0x7e};//LED从高位往低位移(最高位始终为0) uchar i,j;                //定义循环变量 uint tt=70;                //定义时间指数 void delay(uint time)        //延时函数 {         uint x,y;         for(x=time;x>0;x--)         for(y=110;y>0;y--); } void disp0()                        //状态
打开App,查看更多内容
随时随地看视频慕课网APP