/* 下面我写的这个C51程序少了什么? */ #include<reg52.h>
#define uchar unsigned char code uint design[]= { 0xff,0xfe,0xfd,0xfb,0xe7,0xef,0xdf,0xbf,0x7f, 0x7f,0xbf,0xdf,0xef,0xe7,0xfb,0xfd,0xfe,0xff, 0xff,0xfe,0xfc,0xe0,0xc0,0x80,0x00,0xe7,0xdb, 0xbd,0x7e,0xff }; void delay_ms(uint x) { uchar t; while(x--) for(t=0;t<120;t++); } void main(void)
{ uint i; uint * p; p= design; { for(i=0;i<30;i++) { P2= p[i]; delay_ms(50); } } } // --完--
/* 对, 少了while循环语句, 似乎违章, 你用Proteus仿真运行一下, 看看如何? 有点意思.
|
|