• 大小: 26KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-11
  • 语言: C/C++
  • 标签: 单片机  

资源简介

六个8X8点阵拼接滚动显示汉字的C语言程序

资源截图

代码片段和文件信息

#include “reg51.h“

#define uchar unsigned char
#define uint  unsigned int

#define Lie   P1

sbit SHCP = P2^0;
sbit  DS  = P2^1;
sbit STCP = P2^2;

uchar code led[ ] ={
0x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x00
0x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x00

0x000x000xF80x030x080x010x080x010x080x010x080x010x080x010xFF0xFF
0x080x010x080x010x080x010x080x010x080x010xF80x030x000x000x000x00

0x000x000xFE0xFF0x020x400x0A0x500x8A0x500x8A0x500x8A0x500xFA0x5F
0x8A0x500x8A0x560x8A0x540x0A0x500x020x400xFE0xFF0x000x000x000x00

0x100x400x100x200x100x100xFF0x0F0x100x200x100x400xF00x3F0x000x00
0x000x000xF80x7F0x080x200x080x200x080x200xF80x7F0x000x000x000x00

0x100x040x620x040x440xFE0x080x010x000x000xF00xFF0x100x420x100x42
0x100x420xFF0x7F0x100x420x100x420x100x420xF00xFF0x000x000x000x00

0x000x000x000x000x000x000x000x300x000x780x000x780x800x330xE00x03
0xF80x010xFE0x000x7F0x000x1F0x000x070x000x000x000x000x000x000x00

0x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x00
0x000x000x000x000x000x000x000x000x000x000x000x000x000x000x000x00

}; 


//uchar led[]={}

void shift16bit(uchar dat1uchar dat2)  //595??16???
{
 uchar i;
 STCP=0;
 for(i=0;i<8;i++)
  {
   SHCP=0;
   if(dat1  & 0x80) DS=1;
   else DS=0;
   dat1<<=1;
   SHCP=1;
  }
  for(i=0;i<8;i++)
  {
   SHCP=0;
   if(dat2 &0x80) DS=1;
   else DS=0;
   dat2<<=1;
   SHCP=1;
  }
 STCP=1;
}

void delay(uint x)
{
 uint i;
 for(i=0;i}

void main()
{
 uchar ix=0;
 uint n;
 
 while(1)
 {
for(n=0;n<5;n++) 
 for(i=0;i<24;i++)
  {
   Lie=i;
   shift16bit(led[2*i+2*x+1]led[2*i+2*x]);
   delay(100);
  }
  x++;
  
if(x==96) x=0;
}
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        2012  2020-02-15 10:20  点阵.c
     文件        1383  2020-02-16 15:52  点阵.hex
     文件       14451  2020-02-12 11:39  点阵.uvproj
     文件       23761  2020-02-15 10:05  6个88点阵拼接显示.pdsprj

评论

共有 条评论