標(biāo)題: 閑來無事隨意寫回復(fù)8*8點陣顯示箭頭 單片機程序 [打印本頁]

作者: xianfajushi    時間: 2022-12-1 13:58
標(biāo)題: 閑來無事隨意寫回復(fù)8*8點陣顯示箭頭 單片機程序
緣由http://www.torrancerestoration.com/bbs/dpj-225369-1.html

#include<reg52.h>
unsigned char code M[]={
        0xff,0xff,0xfe,0xfd,0xf8,0xfd,0xfe,0xff,
  0xff,0xff,0xfd,0xfb,0xf0,0xfb,0xfd,0xff,
  0xff,0xff,0xfb,0xf7,0xe0,0xf7,0xfb,0xff,
  0xff,0xff,0xf7,0xef,0xc0,0xef,0xf7,0xff,
  0xff,0xff,0xef,0xdf,0x80,0xdf,0xef,0xff,
  0xff,0xff,0xdf,0xbf,0x00,0xbf,0xdf,0xff};

void main()
{
        unsigned char wei=0,zt=1,ys=0,cs=0,sj=0;
        while(1)
        {

                if(wei==0)wei=1;else wei*=2;
                P3=M[sj+cs];
                P2=wei;
                while(++ys);
                P2=P3=255;
                if(++sj>8){sj=0;++zt;}
                if(zt>47){cs+=8;if(cs>40)cs=0;zt=0;}
        }
}






歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1