给你一个51单片机的源程序,一般人我不告诉他!
/*************************** 样式变换LED灯 ***************************
将LED灯的变换样式存入数组中,通过P1口来输出显示。当某位=0时,对应的LED点亮;为1时,则对应的LED熄灭。
*******************************************************************/
#include
void main(void) {
const unsigned char lscd[32] = {
0xff,0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f,0x7e,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,
0xfe,0xff,0xff,0xfe,0xfc,0xf8,0xf0,0xe0,0xc0,0x80,0x00,0xe7,0xdb,0xbd,0x7e,0xff };
unsigned int i;
unsigned char j;
do {
for (j = 0;j<32;j++); {
for (i = 0;i<30000;i++);
P1 = lscd[j];
}
}
while (1);
}
|
|
2016-11-4 10:14:40
评论
举报
|
|
|