感谢大熙熙 对51单片机点阵代码的详细分析
http://www.cnblogs.com/one-meter/p/4188277.html
网址阐述了他对代码的解析
不过部分代码解析不够透彻
我融入了个人对代码的理解
并且做了详细的解析
代码参考了普中给的代码
网上代码很多可以自己下载测试
代码如下
#include <reg52.h>
#include <intrins.h>
//重定义 函数变量
#define uchar unsigned char
#define uint unsigned int
#define ulong unsigned long
//spi 所使用的 3个管脚 并进行定义
sbit MOSIO =P3^4;
sbit R_CLK =P3^5;
sbit S_CLK =P3^6;
//--点阵显示数组--//
uchar code tab0[] = {0x00, 0x01, 0x00, 0x02, 0x00, 0x04, 0x00, 0x08,
0x00, 0x10, 0x00, 0x20, 0x00, 0x40, 0x00, 0x80,
0x01, 0x00, 0x02, 0x00, 0x04, 0x00, 0x08, 0x00,
0x10, 0x00, 0x20, 0x00, 0x40, 0x00, 0x80, 0x00};
//--10字模--//
uchar code tab1[] =
{0, 0, 0, 0, 0, 0, 8, 24, 14, 36, 8, 66, 8, 66, 8, 66,
8, 66, 8, 66, 8, 66, 8, 36, 62, 24, 0, 0, 0, 0, 0, 0};
//--09字模--//
uchar code tab2[] =
{0, 0, 0, 0, 0, 0, 24, 24, 36, 36, 66, 66, 66, 66, 66,
66, 66, 100, 66, 88, 66, 64, 66, 64, 36, 3