LED点阵模仿舞台灯光
时间:11-29
来源:互联网
点击:
用的是单色的8*8点阵,行和列分别接在p0和p1口,实现效果比较牛逼.
#include#define uint unsigned int#define uchar unsigned charuchar code LED1[]={0x18,0x3c,0x7e,0xff,0x7e,0x3c}; uchar code LED2[]={0xe7,0xc3,0x81,0,0x81,0xc3,0xe7};uchar code su[]={10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,140,130,120,110,100,90,80,70,60,50,40,30,20,};void delay(uint z);void main(){uint i=0,j=0; while(1){if(i==6){ i=0; j++;} P1=LED1[i];P0=LED2[i];i++;delay(su[j]);if(j==28)j=0;}}void delay(uint z) //延时函数{uint x,y;for(x=z;x>0;x--)for(y=110;y>0;y--);}
LED点阵舞台灯 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)