找回密码
 注册会员
更新自动建库工具PCB Footprint Expert 2024.04 Pro / Library Expert 破解版

16X16点阵横向扫描是如何左移的?

[复制链接]
小祥 发表于 2014-10-19 11:33:31 | 显示全部楼层 |阅读模式

本文包含原理图、PCB、源代码、封装库、中英文PDF等资源

您需要 登录 才可以下载或查看,没有账号?注册会员

×
下面是一个静态显示的程序,如何改为左移的?附有图片,大神们帮帮忙吧!
#include<reg52.h>
#include<intrins.h>
#define uint unsigned int
#define uchar unsigned char
sbit SH_CP = P3^0;
sbit DS = P3^1;
sbit ST_CP = P3^2;
uchar temp;
uchar code hang[]={
       
/*--  好 --*/
/*--  Trebuchet MS12;  ??????????:?x?=16x16   --*/
0x10,0x00,0x10,0xFC,0x10,0x04,0x10,0x08,0xFC,0x10,0x24,0x20,0x24,0x20,0x25,0xFE,
0x24,0x20,0x48,0x20,0x28,0x20,0x10,0x20,0x28,0x20,0x44,0x20,0x84,0xA0,0x00,0x40,

/*--  好  --*/
/*--  Trebuchet MS12;  ??????????:?x?=16x16   --*/
0x10,0x00,0x10,0xFC,0x10,0x04,0x10,0x08,0xFC,0x10,0x24,0x20,0x24,0x20,0x25,0xFE,
0x24,0x20,0x48,0x20,0x28,0x20,0x10,0x20,0x28,0x20,0x44,0x20,0x84,0xA0,0x00,0x40,

/*--  学 --*/
/*--  Trebuchet MS12;  ??????????:?x?=16x16   --*/
0x22,0x08,0x11,0x08,0x11,0x10,0x00,0x20,0x7F,0xFE,0x40,0x02,0x80,0x04,0x1F,0xE0,
0x00,0x40,0x01,0x80,0xFF,0xFE,0x01,0x00,0x01,0x00,0x01,0x00,0x05,0x00,0x02,0x00,

/*--  习  --*/
/*--  Trebuchet MS12;  ??????????:?x?=16x16   --*/
0x00,0x00,0x7F,0xF8,0x00,0x08,0x00,0x08,0x08,0x08,0x04,0x08,0x02,0x08,0x02,0x08,
0x00,0x68,0x01,0x88,0x0E,0x08,0x70,0x08,0x20,0x08,0x00,0x08,0x00,0x50,0x00,0x20,

/*-- 天 --*/
/*--  Trebuchet MS12;  ??????????:?x?=16x16   --*/
0x00,0x00,0x3F,0xF8,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0xFF,0xFE,0x01,0x00,
0x02,0x80,0x02,0x80,0x04,0x40,0x04,0x40,0x08,0x20,0x10,0x10,0x20,0x08,0xC0,0x06,

/*--  天 --*/
/*--  Trebuchet MS12;  ??????????:?x?=16x16   --*/
0x00,0x00,0x3F,0xF8,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0xFF,0xFE,0x01,0x00,
0x02,0x80,0x02,0x80,0x04,0x40,0x04,0x40,0x08,0x20,0x10,0x10,0x20,0x08,0xC0,0x06,

/*--  向 --*/
/*--  Trebuchet MS12;  ??????????:?x?=16x16   --*/
0x02,0x00,0x04,0x00,0x08,0x00,0x7F,0xFC,0x40,0x04,0x40,0x04,0x47,0xC4,0x44,0x44,
0x44,0x44,0x44,0x44,0x44,0x44,0x47,0xC4,0x44,0x44,0x40,0x04,0x40,0x14,0x40,0x08,

/*--  上  --*/
/*--  Trebuchet MS12;  ??????????:?x?=16x16   --*/
0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x03,0xF8,0x02,0x00,
0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0xFF,0xFE,0x00,0x00,

};
void delay(uint z)
{
        uint x,y;
        for(x=z;x>0;x--)
                for(y=110;y>0;y--);
}

void In_595()
{
        uchar i;
        for(i=0;i<8;i++)
        {
                 temp <<= 1;
                DS   = CY;
                SH_CP = 1;
                _nop_();
                _nop_();
                SH_CP = 0;
        }
}

void out_595()
{
        ST_CP = 0;
        _nop_();
        ST_CP = 1;
        _nop_();
        ST_CP = 0;
}

void main()
{
        uint i;
        while(1)
        {
                for(i=0;i<16;i++)
                        {
                                P2 = (P2+1)%16;
                                temp = hang[i*2];
                                In_595();
                                temp = hang[i*2+1];
                                In_595();
                                out_595();
                                delay(1);
                        }
        }
}
JSOY]ZR_7)6LBL[~[A69FU9.png
*滑块验证:
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

QQ|手机版|MCU资讯论坛 ( 京ICP备18035221号-2 )|网站地图

GMT+8, 2024-11-23 10:50 , Processed in 0.066072 second(s), 15 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表