关于单片机控制的点阵程序问题

关于单片机控制的点阵程序问题,第1张

unsigned char code hanzi[]={{},{},{},}你这样是相矛盾了。

unsigned char code hanzi[]=这表示定义和声明一个无符号字符型的一维数组。

不过{}花括号内的初始化值却是表达成了二维数组的形式。

可以这样修改unsigned char code hanzi[][这个数不能缺,列有几个就填几]={{},{},{},}。

或者unsigned char code hanzi[]={}不过估计这不是你想要的,因为这样代码的寻找就要加判断语句了。

贴上一段:

#include<reg52h>

武汉鸭脖好好吃

unsigned char code hanzi[][8];

被黑虎掏心了

unsigned char code hanzi[][8]={

{0xF8,0xC3,0xF3,0xF3,0xF3,0x00,0xF3,0xF3},

{0xF0,0xC3,0x13,0xF3,0xF2,0xF3,0xC3,0xE7},

{0x9F,0x87,0x93,0x93,0x9F,0x00,0x9F,0x93},

{0xC3,0xC7,0xCF,0x87,0x24,0xF0,0xF8,0xFC},

{0xF0,0xF2,0xE6,0xE6,0xC1,0xC9,0x89,0x09},

{0xC9,0xC9,0xC9,0xC9,0xC9,0xC9,0xC9,0xFF},

{0xFF,0x7F,0x01,0x79,0xF9,0xF9,0xF9,0xF9},

{0xF9,0xF9,0xF9,0xF9,0xF9,0xE1,0xF3,0xFF},

{0xFF,0xFF,0xFF,0xC0,0xCF,0xCF,0xC0,0xCC},

{0xCC,0xCC,0xCC,0xC0,0x99,0x9E,0x38,0xFF},

{0x0F,0x27,0x3F,0x00,0x3F,0x3F,0x33,0x31},

{0x93,0x87,0xCF,0x8F,0x24,0x70,0xF8,0xFC},

{0xFF,0xFF,0x80,0xF3,0xF0,0xF3,0xF3,0xF3},

{0xF2,0xF0,0x07,0x9F,0xFE,0xFC,0xF9,0xFF},

{0xCF,0xCF,0x4F,0xCF,0x01,0xC9,0xC9,0x99},

{0x19,0x99,0x39,0x39,0x79,0x83,0xE7,0xFF},

{0xFF,0x80,0xFF,0xFF,0xFE,0xFE,0xFE,0xFE},

{0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xF8,0xFC},

{0xFF,0x01,0xE3,0x8F,0x3F,0x7F,0x7F,0x7F},

{0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0xFF},

};

将四个点阵按照同样的方向排列,即有字一面向着同一方向,假设四个点阵的排列方式为:

00 01

10 11

将00与01的行控制线一对一连接,10和11的行控制线一对一连接;

00与10的列控制线一对一连接,01和11的列控制线一对一连接。

最后,00和01的16根列控制线就是16x16的列控制线;

00和10的行控制线就是16x16的行控制线。

其实无论用什么来控制,原理都是一样的,不同的是寄存器和端口的 *** 作罢了。像点亮8x8点阵这种应该是属于非常基础的IO应用了,你可以用软件自带的仿真器仿真端口是否有电平输出,以此来验证你的程序是否把寄存器配置正确了。

然后可以通过单排的LED灯来验证硬件是否是完好的。

再然后用万用表检测一下你的点阵是否完好,你的驱动电路是否正常。

点阵,说白了就是动态扫描显示,简单的显示程序没什么难度的。

程序要看你焊接的电路是怎样的,要实现什么功能用得什么管子等。自己做PCB得把画好的图打印出来然后转印到油纸上,然后用热转印机印到覆铜板上,再用三氯化铁加少量盐酸兑出来的溶液进行腐蚀,腐蚀得10分钟左右的时间。

转印到油纸上得需专用设备,经我们测试直接用打印机打出来的纸附到铜板上,然后用水泡,用手轻轻的把纸搓下来,剩下的就是板图样了,特挺好使。

/ 点阵字模工具编程辅助效果示例 /

/

该示例中的字模数组均由“点阵字模工具”生成,你可以用你自己需要的点阵信息来

替换示例中的字模信息,注意字模大小要一致,否则显示会出问题。

用WIN-TC的字模工具生成指定字模信息能给你提供方便的集成小型字库解决方案

/

#include "Conioh"

#include "graphicsh"

#define closegr closegraph

void initgr(void) / BGI初始化 /

{

int gd = DETECT, gm = 0; / 和gd=VGA,gm=VGAHI是同样效果 /

registerbgidriver(EGAVGA_driver);/ 注册BGI驱动后可以不需要BGI文件的支持运行 /

initgraph(&gd, &gm, "");

}

void drawmat(char mat,int matsize,int x,int y,int color)

/依次:字模指针、点阵大小、起始坐标(x,y)、颜色/

{

int i, j, k, n;

n = (matsize - 1) / 8 + 1;

for(j = 0; j < matsize; j++)

for(i = 0; i < n; i++)

for(k = 0;k < 8; k++)

if(mat[j n + i] & (0x80 >> k)) /测试为1的位则显示/

putpixel(x + i 8 + k, y + j, color);

}

char yi12[]={

/ 以下是 '1' 的 12点阵宋体 字模,24 byte /

0x00,0x00,0x0C,0x00,0x1C,0x00,0x3C,0x00,

0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,

0x0C,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,

};

char er12[]={

/ 以下是 '2' 的 12点阵宋体 字模,24 byte /

0x00,0x00,0x3E,0x00,0x63,0x00,0x03,0x00,

0x06,0x00,0x0C,0x00,0x18,0x00,0x30,0x00,

0x63,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,

};

char dian12[]={

/ 以下是 '点' 的 12点阵宋体 字模,24 byte /

0x04,0x00,0x07,0xC0,0x04,0x00,0x04,0x00,

0x3F,0x80,0x20,0x80,0x20,0x80,0x3F,0x80,

0x00,0x00,0x49,0x40,0xC9,0x20,0x00,0x00,

};

char zhen12[]={

/ 以下是 '阵' 的 12点阵宋体 字模,24 byte /

0xF2,0x00,0x9F,0xE0,0x92,0x00,0xA5,0x00,

0xA5,0x00,0x97,0xE0,0x91,0x00,0xB1,0x00,

0x8F,0xE0,0x81,0x00,0x81,0x00,0x00,0x00,

};

char song16[]={

/ 以下是 '宋' 的 16点阵宋体 字模,32 byte /

0x02,0x00,0x01,0x00,0x7F,0xFE,0x41,0x04,

0x81,0x08,0x01,0x00,0x7F,0xFC,0x03,0x80,

0x05,0x80,0x05,0x40,0x09,0x20,0x11,0x10,

0x21,0x0E,0x41,0x04,0x01,0x00,0x00,0x00,

};

char ti16[]={

/ 以下是 '体' 的 16点阵宋体 字模,32 byte /

0x10,0x40,0x18,0x40,0x10,0x40,0x20,0x40,

0x37,0xFC,0x60,0xC0,0xA0,0xE0,0x21,0x60,

0x21,0x50,0x22,0x48,0x24,0x4E,0x2B,0xF4,

0x20,0x40,0x20,0x40,0x20,0x40,0x00,0x00,

};

char zi24[]={

/ 以下是 '字' 的 24点阵隶书 字模,72 byte /

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x18,0x00,0x08,0x1C,0x10,

0x1F,0xFF,0xF0,0x18,0x00,0x30,0x18,0xFF,

0x10,0x09,0xC3,0x90,0x00,0x3C,0x00,0x00,

0x1C,0x00,0x3F,0xFF,0xFE,0x7E,0x0C,0xFE,

0x00,0x1C,0x04,0x00,0x1C,0x00,0x04,0x3C,

0x00,0x03,0xF8,0x00,0x00,0xE0,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

};

char mo24[]={

/ 以下是 '模' 的 24点阵楷体_GB2312 字模,72 byte /

0x00,0x00,0x00,0x00,0x00,0x60,0x02,0x00,

0x30,0x03,0x0C,0x20,0x03,0x04,0x3C,0x02,

0x07,0xE0,0x02,0x1C,0x40,0x02,0x00,0x40,

0x03,0xC0,0x70,0x7E,0x1F,0x98,0x02,0x08,

0x10,0x06,0x0F,0x90,0x07,0x88,0x10,0x0A,

0xCB,0xE0,0x1A,0x05,0x00,0x12,0x01,0x1E,

0x22,0x0F,0xFE,0x42,0x32,0x80,0x02,0x02,

0x40,0x02,0x04,0x60,0x02,0x0C,0x30,0x02,

0x18,0x1C,0x02,0x20,0x0F,0x02,0x00,0x00,

};

char guan48[]={

/ 以下是 '灌' 的 48点阵黑体 字模,288 byte /

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x03,0xC0,0x38,0x00,

0x03,0x00,0x03,0xC0,0x38,0x00,0x07,0x80,

0x03,0xC0,0x38,0x00,0x07,0xC0,0x03,0xC0,

0x38,0x00,0x03,0xF1,0xFF,0xFF,0xFF,0xFC,

0x01,0xF9,0xFF,0xFF,0xFF,0xFC,0x00,0x79,

0xF1,0xC0,0x39,0xFC,0x00,0x30,0x01,0xC0,

0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0xFF,0xF0,0xFF,0xE0,0x00,0x00,0xFF,0xF0,

0xFF,0xE0,0x00,0x00,0xE0,0x70,0xE0,0xE0,

0x0E,0x00,0xE0,0x70,0xE0,0xE0,0x1F,0x80,

0xE0,0x70,0xE0,0xE0,0x1F,0xE0,0xFF,0xF0,

0xFF,0xE0,0x07,0xF0,0xFF,0xF0,0xFF,0xE0,

0x01,0xF0,0xFF,0xF1,0xFF,0xE0,0x00,0x60,

0x08,0x07,0x00,0x00,0x00,0x20,0x1E,0x03,

0x80,0x00,0x00,0x00,0x1E,0x03,0x00,0x00,

0x00,0x00,0x1F,0xFF,0xFF,0xF0,0x00,0x00,

0x3F,0xFF,0xFF,0xF0,0x00,0x00,0x3F,0xFF,

0xFF,0xF0,0x00,0x00,0x7C,0x03,0x80,0x00,

0x00,0x20,0x7C,0x03,0x80,0x00,0x00,0x70,

0xFC,0x03,0x80,0x00,0x00,0x71,0xFF,0xFF,

0xFF,0xE0,0x00,0x73,0xFF,0xFF,0xFF,0xE0,

0x00,0xF3,0xBC,0x03,0x80,0x60,0x00,0xE3,

0xBC,0x03,0x80,0x00,0x01,0xE1,0x3C,0x03,

0x80,0x00,0x01,0xC0,0x3F,0xFF,0xFF,0xE0,

0x01,0xC0,0x3F,0xFF,0xFF,0xE0,0x03,0xC0,

0x3F,0xFF,0xFF,0xE0,0x03,0x80,0x3C,0x03,

0x80,0x00,0x07,0x80,0x3C,0x03,0x80,0x00,

0x0F,0x80,0x3C,0x03,0x80,0x00,0x0F,0x00,

0x3F,0xFF,0xFF,0xF8,0x1F,0x00,0x3F,0xFF,

0xFF,0xF8,0x1F,0x00,0x3C,0x00,0x00,0x00,

0x06,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

};

char guan64[]={

/ 以下是 '灌' 的 64点阵方正黄草简体 字模,512 byte /

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,

0x00,0x00,0x00,0x00,0x01,0xFF,0xC0,0x00,

0x00,0x00,0x00,0x00,0x03,0xCF,0xC0,0x00,

0x00,0x00,0x00,0x00,0x1E,0x07,0xC0,0x00,

0x00,0x00,0x00,0x03,0xF8,0x07,0x80,0x00,

0x00,0x04,0x00,0x03,0xF8,0x0F,0x00,0x00,

0x00,0x06,0x00,0x03,0xF0,0x18,0x00,0x00,

0x00,0x07,0x00,0x01,0xF0,0x30,0x00,0x00,

0x00,0x07,0x80,0x01,0xF0,0x00,0x00,0x00,

0x00,0x03,0xC0,0x01,0xF0,0x00,0x00,0x00,

0x00,0x03,0xE0,0x00,0x00,0x06,0x00,0x00,

0x00,0x03,0xF0,0x00,0x00,0x0F,0xE0,0x00,

0x00,0x07,0xF0,0x00,0x00,0x3F,0xC0,0x00,

0x00,0x07,0xE0,0x00,0x01,0xFF,0x00,0x00,

0x00,0x0F,0x00,0x00,0x0F,0xF8,0x00,0x00,

0x00,0x0C,0x00,0x00,0x7F,0xC0,0x00,0x00,

0x00,0x08,0x00,0x03,0xFF,0x00,0x00,0x00,

0x00,0x08,0x00,0x0F,0xF0,0x07,0xC0,0x00,

0x00,0x00,0x00,0x3F,0x40,0x0F,0xC0,0x00,

0x00,0x00,0x00,0x18,0x80,0x3F,0x80,0x00,

0x00,0x00,0x00,0x01,0x00,0x7F,0x00,0x00,

0x00,0x00,0x00,0x03,0x0F,0xFC,0x00,0x00,

0x00,0x00,0x00,0x06,0x1F,0xF8,0x00,0x00,

0x00,0x00,0x00,0x0E,0x23,0xF0,0x00,0x00,

0x00,0x00,0x00,0x0E,0xC3,0xE0,0x00,0x00,

0x00,0x80,0x00,0x1F,0x87,0xC0,0x00,0x00,

0x00,0xC0,0x00,0x1F,0x8F,0x87,0x80,0x00,

0x00,0x70,0x02,0x0F,0x9F,0x0F,0x80,0x00,

0x00,0x7C,0x02,0x0F,0xBE,0x1C,0xE0,0x00,

0x00,0x3E,0x04,0x07,0xFC,0x18,0xE0,0x00,

0x00,0x3E,0x04,0x03,0xF0,0x1B,0xC0,0x00,

0x00,0x3E,0x0C,0x01,0xE0,0x1F,0x80,0x00,

0x00,0x1C,0x08,0x03,0xC0,0x1F,0x00,0x00,

0x00,0x18,0x18,0x07,0x80,0x7C,0x00,0x00,

0x00,0x18,0x38,0x0F,0x01,0xFC,0x00,0x00,

0x00,0x18,0x30,0x1F,0x07,0xDC,0x00,0x00,

0x00,0x30,0x70,0x3F,0x1F,0x0C,0x00,0x00,

0x00,0x30,0x70,0x7B,0x38,0x0C,0x00,0x00,

0x00,0x30,0xE0,0xF3,0x60,0x0C,0x00,0x00,

0x00,0x30,0xE1,0xE3,0x00,0x0E,0x00,0x00,

0x00,0x71,0xC3,0xE3,0x00,0x3E,0x00,0x00,

0x00,0x71,0xC3,0xC3,0x00,0x6E,0x00,0x00,

0x00,0x73,0x83,0xC3,0x00,0xCE,0x00,0x00,

0x00,0x77,0x80,0x07,0x00,0x9E,0x00,0x00,

0x00,0x77,0x80,0x07,0x00,0x9C,0x00,0x00,

0x00,0x7F,0x00,0x07,0x00,0x9C,0x00,0x00,

0x00,0x7F,0x00,0x07,0x00,0xBC,0x00,0x00,

0x00,0x7E,0x00,0x07,0x00,0xFC,0x00,0x00,

0x00,0x7E,0x00,0x07,0x00,0xFC,0x00,0x00,

0x00,0x7C,0x00,0x07,0x00,0xFF,0x00,0x00,

0x00,0x7C,0x00,0x06,0x00,0xDE,0x00,0x00,

0x00,0xFC,0x00,0x06,0x00,0x5C,0x00,0x00,

0x01,0xF8,0x00,0x06,0x00,0x78,0x00,0x00,

0x00,0xF8,0x00,0x0E,0x00,0x78,0xF8,0x00,

0x00,0xF8,0x00,0x0E,0x00,0xFF,0xF8,0x00,

0x00,0x78,0x00,0x0E,0x01,0xFF,0xB0,0x00,

0x00,0x70,0x00,0x06,0x01,0xF0,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

};

char matarray16k[]={

/ 以下是 '该' 的 16点阵楷体_GB2312 字模,32 byte /

0x00,0x00,0x00,0x00,0x08,0x60,0x08,0x00,

0x00,0x0C,0x03,0xF0,0x18,0x50,0x30,0x90,

0x11,0x70,0x11,0xA8,0x14,0x58,0x18,0xB0,

0x13,0x70,0x04,0x8C,0x03,0x04,0x00,0x00,

/ 以下是 '程' 的 16点阵楷体_GB2312 字模,32 byte /

0x00,0x00,0x00,0x00,0x02,0x00,0x0C,0xFC,

0x3C,0x88,0x08,0x88,0x0E,0x70,0xF8,0x18,

0x18,0xE0,0x1E,0x20,0x28,0xF0,0xC8,0x20,

0x08,0x3E,0x09,0xC0,0x08,0x00,0x00,0x00,

/ 以下是 '序' 的 16点阵楷体_GB2312 字模,32 byte /

0x00,0x00,0x00,0x80,0x00,0x90,0x0B,0xE0,

0x0C,0x00,0x0B,0xF0,0x08,0x40,0x10,0x80,

0x11,0xFC,0x1E,0x88,0x20,0x80,0x20,0x80,

0x40,0x80,0x80,0x80,0x01,0x80,0x00,0x80,

/ 以下是 '已' 的 16点阵楷体_GB2312 字模,32 byte /

0x00,0x00,0x00,0x00,0x00,0xC0,0x0F,0x40,

0x00,0xC0,0x10,0x80,0x10,0x80,0x1F,0x00,

0x10,0x00,0x10,0x00,0x10,0x04,0x10,0x04,

0x08,0x06,0x07,0xF8,0x00,0x00,0x00,0x00,

/ 以下是 '集' 的 16点阵楷体_GB2312 字模,32 byte /

0x00,0x00,0x02,0x80,0x04,0x10,0x07,0xE0,

0x0C,0xE0,0x17,0x80,0x05,0xC0,0x06,0xB0,

0x0B,0x40,0x08,0x9C,0x1F,0xE0,0x23,0x40,

0x05,0x30,0x09,0x1C,0x31,0x00,0x00,0x00,

/ 以下是 '成' 的 16点阵楷体_GB2312 字模,32 byte /

0x00,0x00,0x03,0x00,0x01,0x30,0x01,0x10,

0x01,0x00,0x01,0xC0,0x1E,0x80,0x10,0x90,

0x12,0x90,0x1E,0x60,0x12,0x60,0x22,0x60,

0x26,0x92,0x45,0x0A,0x00,0x06,0x00,0x00,

/ 以下是 '小' 的 16点阵楷体_GB2312 字模,32 byte /

0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,

0x01,0x00,0x01,0x00,0x01,0x00,0x11,0x18,

0x11,0x0C,0x21,0x04,0x21,0x00,0x01,0x00,

0x07,0x00,0x03,0x00,0x00,0x00,0x00,0x00,

/ 以下是 '型' 的 16点阵楷体_GB2312 字模,32 byte /

0x00,0x00,0x00,0x08,0x03,0x08,0x1E,0x28,

0x0A,0x48,0x0F,0xC8,0x7A,0x48,0x0A,0x08,

0x12,0x18,0x21,0x08,0x01,0x40,0x07,0x80,

0x01,0x00,0x01,0xF8,0x3E,0x00,0x00,0x00,

/ 以下是 '汉' 的 16点阵楷体_GB2312 字模,32 byte /

0x00,0x00,0x00,0x00,0x30,0x00,0x11,0xF0,

0x02,0x20,0x04,0x20,0x62,0x40,0x29,0x40,

0x10,0x80,0x11,0x40,0x22,0x60,0x64,0x38,

0x78,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,

/ 以下是 '字' 的 16点阵楷体_GB2312 字模,32 byte /

0x00,0x00,0x01,0x00,0x01,0x10,0x11,0xF8,

0x1E,0x10,0x20,0xC0,0x07,0xC0,0x00,0x80,

0x01,0x38,0x1F,0xC0,0x20,0x80,0x00,0x80,

0x00,0x80,0x00,0x80,0x01,0x80,0x00,0x00,

/ 以下是 '库' 的 16点阵楷体_GB2312 字模,32 byte /

0x00,0x00,0x00,0x80,0x00,0x80,0x01,0xF0,

0x0E,0x80,0x08,0xF0,0x0B,0x00,0x09,0x40,

0x0A,0x78,0x13,0xC0,0x10,0x7E,0x2F,0xC0,

0x20,0x40,0x40,0x40,0x00,0x40,0x00,0x40,

/ 以下是 ',' 的 16点阵楷体_GB2312 字模,32 byte /

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,

0x10,0x00,0x10,0x00,0x20,0x00,0x00,0x00,

/ 以下是 '可' 的 16点阵楷体_GB2312 字模,32 byte /

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,

0x7F,0x40,0x00,0x20,0x07,0x20,0x19,0x20,

0x12,0x20,0x0E,0x40,0x00,0x40,0x00,0x40,

0x00,0x40,0x00,0xC0,0x00,0x40,0x00,0x00,

/ 以下是 '脱' 的 16点阵楷体_GB2312 字模,32 byte /

0x00,0x00,0x00,0x00,0x00,0x08,0x3D,0x90,

0x24,0x80,0x24,0x70,0x25,0x90,0x25,0x20,

0x35,0xE0,0x24,0xA0,0x24,0xC0,0x45,0x42,

0x4E,0x22,0x88,0x3E,0x00,0x00,0x00,0x00,

/ 以下是 '离' 的 16点阵楷体_GB2312 字模,32 byte /

0x00,0x00,0x03,0x00,0x01,0x30,0x1F,0xC0,

0x00,0xA0,0x0F,0xA0,0x0A,0xA0,0x0F,0xE0,

0x09,0x00,0x03,0xF8,0x1E,0x88,0x17,0xC8,

0x14,0x88,0x10,0x70,0x10,0x10,0x00,0x00,

/ 以下是 '文' 的 16点阵楷体_GB2312 字模,32 byte /

0x00,0x00,0x02,0x00,0x01,0x80,0x00,0x00,

0x00,0x70,0x07,0x80,0x18,0x80,0x01,0x80,

0x05,0x00,0x03,0x00,0x03,0x00,0x04,0xC0,

0x38,0x70,0x00,0x3E,0x00,0x00,0x00,0x00,

/ 以下是 '件' 的 16点阵楷体_GB2312 字模,32 byte /

0x00,0x00,0x08,0x40,0x0C,0x40,0x08,0x40,

0x11,0x40,0x11,0xF0,0x32,0x40,0x50,0x44,

0x91,0xF8,0x12,0x40,0x10,0x40,0x10,0x40,

0x10,0x40,0x10,0x40,0x00,0x00,0x00,0x00,

/ 以下是 '的' 的 16点阵楷体_GB2312 字模,32 byte /

0x00,0x00,0x00,0x00,0x00,0x20,0x0C,0x20,

0x08,0x40,0x10,0x48,0x1E,0xFC,0x23,0x0C,

0x24,0x8C,0x3C,0x48,0x24,0x08,0x24,0x08,

0x3C,0x08,0x00,0x38,0x00,0x18,0x00,0x00,

/ 以下是 '支' 的 16点阵楷体_GB2312 字模,32 byte /

0x00,0x00,0x01,0x00,0x01,0x00,0x01,0x00,

0x01,0xE0,0x0F,0x00,0x01,0x00,0x01,0xC0,

0x0E,0x40,0x08,0x80,0x06,0x80,0x01,0x00,

0x02,0xC0,0x0C,0x78,0x30,0x1C,0x00,0x00,

/ 以下是 '持' 的 16点阵楷体_GB2312 字模,32 byte /

0x00,0x00,0x08,0x20,0x08,0x20,0x08,0x20,

0x08,0x70,0x3C,0x20,0x08,0x3E,0x0F,0xD0,

0x08,0x1C,0x3B,0xF0,0xC9,0x10,0x08,0x90,

0x08,0x10,0x18,0x10,0x00,0x30,0x00,0x00,

/ 以下是 '运' 的 16点阵楷体_GB2312 字模,32 byte /

0x00,0x00,0x00,0x00,0x00,0x60,0x11,0x80,

0x00,0x00,0x00,0x78,0x27,0x80,0x71,0x80,

0x21,0x20,0x22,0xF0,0x23,0x10,0x20,0x00,

0x5F,0x80,0x00,0xFC,0x00,0x00,0x00,0x00,

/ 以下是 '行' 的 16点阵楷体_GB2312 字模,32 byte /

0x00,0x00,0x00,0x00,0x06,0x00,0x0C,0x38,

0x10,0x40,0x24,0x00,0x04,0x1F,0x0B,0xF0,

0x18,0x10,0x28,0x10,0xC8,0x10,0x08,0x10,

0x08,0x10,0x08,0x70,0x00,0x20,0x00,0x00,

};

int main(void)

{

int i, j;

initgr(); / BGI初始化 /

drawmat(yi12, 12, 100, 125, WHITE);

drawmat(er12, 12, 115, 125, WHITE);

drawmat(dian12, 12, 130, 125, WHITE);

drawmat(zhen12, 12, 145, 125, WHITE);

drawmat(song16, 16, 160, 123, YELLOW);

drawmat(ti16, 16, 180, 123, YELLOW);

drawmat(zi24, 24, 200, 119, CYAN);

drawmat(mo24, 24, 230, 117, GREEN);

drawmat(guan48, 48, 350, 110, RED);

drawmat(guan64, 64, 410, 100, YELLOW);

for(i = 0; i < 15; i++)

drawmat(matarray16k + i 32, 16, 200 + i 15, 200, WHITE);

drawmat(matarray16k + 8 32, 16, 200 + i 15, 200, WHITE);

drawmat(matarray16k + 9 32, 16, 200 + (++i) 15, 200, WHITE);

drawmat(matarray16k + 10 32, 16, 200 + (++i) 15, 200, WHITE);

for(i = 18; i < 25; i++)

drawmat(matarray16k + (i - 3) 32, 16, 200 + i 15, 200, WHITE);

getch(); / 暂停一下,看看前面绘图代码的运行结果 /

closegr(); / 恢复TEXT屏幕模式 /

return 0;

}

在8X8点阵LED上显示柱形,让其先从左到右平滑移动三次,其次从右到左平滑移动三次,再次从上到下平滑移动三次,最后从下到上平滑移动三次,如此循环下去。

1. 程序设计内容

8X8点阵LED工作原理说明 :8X8点阵共需要64个发光二极管组成,且每个发光二极管是放置在行线和列线的交叉点上,当对应的某一列置1电平,某一行置0电平,则相应的二极管就亮;因此要实现一根柱形的亮法,如图49所示,对应的一列为一根竖柱,或者对应的一行为一根横柱,因此实现柱的亮的方法如下所述:

一根竖柱:对应的列置1,而行则采用扫描的方法来实现。

一根横柱:对应的行置0,而列则采用扫描的方法来实现。

以上就是关于关于单片机控制的点阵程序问题全部的内容,包括:关于单片机控制的点阵程序问题、KEIL 32*26LED点阵程序帮忙排除问题、有谁用STM32写过8x8点阵的程序,该如何来实现等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zz/9822257.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-02
下一篇 2023-05-02

发表评论

登录后才能评论

评论列表(0条)

保存