本文包含原理图、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[]={
/*-- oà --*/
/*-- 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,
/*-- oà --*/
/*-- 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 out_5951()
{
ST_CP = 0;
_nop_();
ST_CP = 0;
_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);
}
}
} |