代码拉取完成,页面将自动刷新
#include "stm32f0xx.h"
#include "LCD_PARALLEL_12864.h"
#define u16 unsigned short
void delay_ms( int i )
{
int j;
while(i)
{
i--;
for( j=0;j<15;j++ );
}
}
const u8 Number8X16[]={
/*-- 文字: 0 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/
0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00,
/*-- 文字: 1 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/
0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,
/*-- 文字: 2 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/
0x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00,
/*-- 文字: 3 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/
0x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00,0x00,0x18,0x20,0x20,0x20,0x11,0x0E,0x00,
/*-- 文字: 4 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/
0x00,0x00,0xC0,0x20,0x10,0xF8,0x00,0x00,0x00,0x07,0x04,0x24,0x24,0x3F,0x24,0x00,
/*-- 文字: 5 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/
0x00,0xF8,0x08,0x88,0x88,0x08,0x08,0x00,0x00,0x19,0x21,0x20,0x20,0x11,0x0E,0x00,
/*-- 文字: 6 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/
0x00,0xE0,0x10,0x88,0x88,0x18,0x00,0x00,0x00,0x0F,0x11,0x20,0x20,0x11,0x0E,0x00,
/*-- 文字: 7 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/
0x00,0x38,0x08,0x08,0xC8,0x38,0x08,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,
/*-- 文字: 8 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/
0x00,0x70,0x88,0x08,0x08,0x88,0x70,0x00,0x00,0x1C,0x22,0x21,0x21,0x22,0x1C,0x00,
/*-- 文字: 9 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/
0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x00,0x31,0x22,0x22,0x11,0x0F,0x00,
/*-- 文字: . --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x00,0x00,
/*-- V(0)--*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/
0x08,0x78,0x88,0x00,0x00,0xC8,0x38,0x08,0x00,0x00,0x07,0x38,0x0E,0x01,0x00,0x00,
/*-- A(0)--*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/
0x00,0x00,0xC0,0x38,0xE0,0x00,0x00,0x00,0x20,0x3C,0x23,0x02,0x02,0x27,0x38,0x20,
/*-- W(0)--*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/
0x08,0xF8,0x00,0xF8,0x00,0xF8,0x08,0x00,0x00,0x03,0x3E,0x01,0x3E,0x03,0x00,0x00,/*"W",0*/
/*-- m(0)--*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/
0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x20,0x3F,0x20,0x00,0x3F,0x20,0x00,0x3F,/*"m",0*/
/*-- h(0)--*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/
0x10,0xF0,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20/*"h",0*/
};
const u8 Number16X16[]=
{
/*-- 文字: 电 0 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x00,0xF8,0x88,0x88,0x88,0x88,0xFF,0x88,0x88,0x88,0x88,0xF8,0x00,0x00,0x00,
0x00,0x00,0x1F,0x08,0x08,0x08,0x08,0x7F,0x88,0x88,0x88,0x88,0x9F,0x80,0xF0,0x00,
/*-- 文字: 压 1 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x00,0xFE,0x02,0x82,0x82,0x82,0x82,0xFA,0x82,0x82,0x82,0x82,0x82,0x02,0x00,
0x80,0x60,0x1F,0x40,0x40,0x40,0x40,0x40,0x7F,0x40,0x40,0x44,0x58,0x40,0x40,0x00,
/*-- 文字: 流 2 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x10,0x60,0x02,0x8C,0x00,0x44,0x64,0x54,0x4D,0x46,0x44,0x54,0x64,0xC4,0x04,0x00,
0x04,0x04,0x7E,0x01,0x80,0x40,0x3E,0x00,0x00,0xFE,0x00,0x00,0x7E,0x80,0xE0,0x00,
/*-- 文字: : 3 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x36,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
/*-- 文字: 功 4 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x08,0x08,0x08,0xF8,0x08,0x08,0x08,0x10,0x10,0xFF,0x10,0x10,0x10,0xF0,0x00,0x00,
0x10,0x30,0x10,0x1F,0x08,0x88,0x48,0x30,0x0E,0x01,0x40,0x80,0x40,0x3F,0x00,0x00,
/*-- 文字: 率 5--*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x14,0xA4,0x44,0x24,0x34,0xAD,0x66,0x24,0x94,0x04,0x44,0xA4,0x14,0x00,0x00,
0x08,0x09,0x08,0x08,0x09,0x09,0x09,0xFD,0x09,0x09,0x0B,0x08,0x08,0x09,0x08,0x00,
/*-- 文字: 容 6 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x10,0x0C,0x44,0x24,0x14,0x84,0x45,0x26,0x44,0x84,0x14,0x24,0x44,0x14,0x0C,0x00,
0x04,0x04,0x02,0xFE,0x45,0x44,0x44,0x44,0x44,0x44,0x45,0xFE,0x02,0x04,0x04,0x00,
/*-- 文字: 量 7--*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x20,0x20,0x20,0xBE,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xBE,0x20,0x20,0x20,0x00,
0x00,0x80,0x80,0xAF,0xAA,0xAA,0xAA,0xFF,0xAA,0xAA,0xAA,0xAF,0x80,0x80,0x00,0x00,
/*-- 文字: 单 8 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x00,0xF8,0x49,0x4A,0x4C,0x48,0xF8,0x48,0x4C,0x4A,0x49,0xF8,0x00,0x00,0x00,
0x10,0x10,0x13,0x12,0x12,0x12,0x12,0xFF,0x12,0x12,0x12,0x12,0x13,0x10,0x10,0x00,
/*-- 文字: 参 9 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x20,0x20,0xA8,0x6C,0x2A,0x39,0x28,0xA8,0x2A,0x6C,0xA8,0x20,0x20,0x00,0x00,
0x02,0x82,0x81,0x90,0x92,0x4A,0x49,0x45,0x24,0x22,0x10,0x08,0x01,0x02,0x02,0x00,
/*-- 文字: 数 10 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x90,0x52,0x34,0x10,0xFF,0x10,0x34,0x52,0x80,0x70,0x8F,0x08,0x08,0xF8,0x08,0x00,
0x82,0x9A,0x56,0x63,0x22,0x52,0x8E,0x00,0x80,0x40,0x33,0x0C,0x33,0x40,0x80,0x00,
/*-- 文字: 设 11 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x40,0x40,0x42,0xCC,0x00,0x40,0xA0,0x9E,0x82,0x82,0x82,0x9E,0xA0,0x20,0x20,0x00,
0x00,0x00,0x00,0x3F,0x90,0x88,0x40,0x43,0x2C,0x10,0x28,0x46,0x41,0x80,0x80,0x00,
/*-- 文字: 置 12--*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x17,0x15,0xD5,0x55,0x57,0x55,0x7D,0x55,0x57,0x55,0xD5,0x15,0x17,0x00,0x00,
0x40,0x40,0x40,0x7F,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x7F,0x40,0x40,0x40,0x00,
/*-- 文字: 度 13--*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x00,0xFC,0x24,0x24,0x24,0xFC,0x25,0x26,0x24,0xFC,0x24,0x24,0x24,0x04,0x00,
0x40,0x30,0x8F,0x80,0x84,0x4C,0x55,0x25,0x25,0x25,0x55,0x4C,0x80,0x80,0x80,0x00,
/*-- 文字: 上 14--*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00,
0x40,0x40,0x40,0x40,0x40,0x40,0x7F,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,
/*-- 文字: 下 15 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x02,0x02,0x02,0x02,0x02,0x02,0xFE,0x02,0x02,0x42,0x82,0x02,0x02,0x02,0x02,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x01,0x06,0x00,0x00,0x00,
/*-- 文字: 限 16 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0xFE,0x22,0x5A,0x86,0x00,0xFE,0x92,0x92,0x92,0x92,0x92,0xFE,0x00,0x00,0x00,
0x00,0xFF,0x04,0x08,0x07,0x00,0xFF,0x40,0x20,0x03,0x0C,0x14,0x22,0x41,0x40,0x00,
/*-- 文字: 开 17 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x80,0x82,0x82,0x82,0xFE,0x82,0x82,0x82,0x82,0x82,0xFE,0x82,0x82,0x82,0x80,0x00,
0x00,0x80,0x40,0x30,0x0F,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,
/*-- 文字: 启 18 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x00,0x00,0xFC,0x44,0x44,0x44,0x45,0x46,0x44,0x44,0x44,0x44,0x7C,0x00,0x00,
0x40,0x20,0x18,0x07,0x00,0xFC,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0xFC,0x00,0x00,
/*-- 文字: 关 19 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x00,0x10,0x11,0x16,0x10,0x10,0xF0,0x10,0x10,0x14,0x13,0x10,0x00,0x00,0x00,
0x81,0x81,0x41,0x41,0x21,0x11,0x0D,0x03,0x0D,0x11,0x21,0x41,0x41,0x81,0x81,0x00,
/*-- 文字: 闭 20 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0xF8,0x01,0x22,0x20,0x22,0x22,0xA2,0xFA,0x22,0x22,0x22,0x02,0xFE,0x00,0x00,
0x00,0xFF,0x00,0x08,0x04,0x02,0x11,0x20,0x1F,0x00,0x00,0x40,0x80,0x7F,0x00,0x00,
/*-- 文字: 通 21 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x40,0x42,0xCC,0x00,0x00,0xE2,0x22,0x2A,0x2A,0xF2,0x2A,0x26,0x22,0xE0,0x00,0x00,
0x80,0x40,0x3F,0x40,0x80,0xFF,0x89,0x89,0x89,0xBF,0x89,0xA9,0xC9,0xBF,0x80,0x00,
/*-- 文字: 信 22 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x80,0x60,0xF8,0x07,0x00,0x04,0x24,0x24,0x25,0x26,0x24,0x24,0x24,0x04,0x00,
0x01,0x00,0x00,0xFF,0x00,0x00,0x00,0xF9,0x49,0x49,0x49,0x49,0x49,0xF9,0x00,0x00,
/*-- 文字: 参 23 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x20,0x20,0xA8,0x6C,0x2A,0x39,0x28,0xA8,0x2A,0x6C,0xA8,0x20,0x20,0x00,0x00,
0x02,0x82,0x81,0x90,0x92,0x4A,0x49,0x45,0x24,0x22,0x10,0x08,0x01,0x02,0x02,0x00,
/*-- 文字: 数 24 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x90,0x52,0x34,0x10,0xFF,0x10,0x34,0x52,0x80,0x70,0x8F,0x08,0x08,0xF8,0x08,0x00,
0x82,0x9A,0x56,0x63,0x22,0x52,0x8E,0x00,0x80,0x40,0x33,0x0C,0x33,0x40,0x80,0x00,
/*-- 文字: 波 25 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x10,0x60,0x02,0x0C,0xC0,0x00,0xF8,0x88,0x88,0x88,0xFF,0x88,0x88,0xA8,0x18,0x00,
0x04,0x04,0x7C,0x03,0x80,0x60,0x1F,0x80,0x43,0x2C,0x10,0x28,0x46,0x81,0x80,0x00,
/*-- 文字: 特 26 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x40,0x3C,0x10,0xFF,0x10,0x10,0x40,0x48,0x48,0x48,0x7F,0x48,0xC8,0x48,0x40,0x00,
0x02,0x06,0x02,0xFF,0x01,0x01,0x00,0x02,0x0A,0x12,0x42,0x82,0x7F,0x02,0x02,0x00,
/*-- 文字: 率 27 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x14,0xA4,0x44,0x24,0x34,0xAD,0x66,0x24,0x94,0x04,0x44,0xA4,0x14,0x00,0x00,
0x08,0x09,0x08,0x08,0x09,0x09,0x09,0xFD,0x09,0x09,0x0B,0x08,0x08,0x09,0x08,0x00,
/*-- 文字: 停 28 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x80,0x60,0xF8,0x07,0x00,0x04,0x74,0x54,0x55,0x56,0x54,0x54,0x74,0x04,0x00,0x00,
0x00,0x00,0xFF,0x00,0x03,0x01,0x05,0x45,0x85,0x7D,0x05,0x05,0x05,0x01,0x03,0x00,
/*-- 文字: 止 29--*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0xFF,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00,
0x40,0x40,0x40,0x7F,0x40,0x40,0x40,0x7F,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,
/*-- 文字: 位 30 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x80,0x60,0xF8,0x07,0x10,0x90,0x10,0x11,0x16,0x10,0x10,0xD0,0x10,0x00,0x00,
0x01,0x00,0x00,0xFF,0x40,0x40,0x41,0x5E,0x40,0x40,0x70,0x4E,0x41,0x40,0x40,0x00,
/*-- 文字: 数 31 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x90,0x52,0x34,0x10,0xFF,0x10,0x34,0x52,0x80,0x70,0x8F,0x08,0x08,0xF8,0x08,0x00,
0x82,0x9A,0x56,0x63,0x22,0x52,0x8E,0x00,0x80,0x40,0x33,0x0C,0x33,0x40,0x80,0x00,
/*-- 文字: 据 32--*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x10,0x10,0xFF,0x10,0x90,0x00,0xFE,0x92,0x92,0x92,0xF2,0x92,0x92,0x9E,0x80,0x00,
0x42,0x82,0x7F,0x01,0x80,0x60,0x1F,0x00,0xFC,0x44,0x47,0x44,0x44,0xFC,0x00,0x00,
/*-- 文字: 校 33 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x10,0x10,0xD0,0xFF,0x90,0x10,0x80,0x48,0x28,0x09,0x0E,0x08,0x28,0x48,0x88,0x00,
0x04,0x03,0x00,0xFF,0x00,0x01,0x80,0x80,0x43,0x2C,0x10,0x2C,0x43,0x80,0x80,0x00,
/*-- 文字: 验 34 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x02,0xFA,0x82,0x82,0xFE,0x80,0x40,0x20,0x50,0x4C,0x43,0x4C,0x50,0x20,0x40,0x00,
0x08,0x18,0x48,0x84,0x44,0x3F,0x40,0x44,0x58,0x41,0x4E,0x60,0x58,0x47,0x40,0x00,
/*-- 文字: 测 35--*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x10,0x60,0x02,0x8C,0x00,0xFE,0x02,0xF2,0x02,0xFE,0x00,0xF8,0x00,0xFF,0x00,0x00,
0x04,0x04,0x7E,0x01,0x80,0x47,0x30,0x0F,0x10,0x27,0x00,0x47,0x80,0x7F,0x00,0x00,
/*-- 文字: 试 36 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x40,0x40,0x42,0xCC,0x00,0x90,0x90,0x90,0x90,0x90,0xFF,0x10,0x11,0x16,0x10,0x00,
0x00,0x00,0x00,0x3F,0x10,0x28,0x60,0x3F,0x10,0x10,0x01,0x0E,0x30,0x40,0xF0,0x00,
};
/**********************************************************************************
**函数名:void LCD_Write_Byte(u8 Cmd,u8 Dat)
**功能:对LCD12864写命令
**说明:无
**参数: Cmd =0 命令 Cmd=1 数据
**********************************************************************************/
void LCD_Write_Byte(u8 Cmd,u8 Dat) //LCD写入函数
{
if(Cmd==0)
{
LCD_RS_L;
}
else
{
LCD_RS_H;
}
LCD_RD_L;
LCD_WR_L;
GPIOA->ODR=(Dat<<4);//|(GPIOA->IDR&0xF00F);
LCD_RD_H;
delay_ms(2);
LCD_RD_L;
}
void LCD_Reset() //LCD硬件复位
{
LCD_RST_L;
delay_ms(50);
LCD_RST_L;
delay_ms(50);
LCD_RST_H;
delay_ms(50);
}
void LCD_Coor(u8 x, u8 y) //LCD坐标控制
{
LCD_Write_Byte(0,0xb0+y); //设置页地址
LCD_Write_Byte(0,(x>>4)+0x10);//设置列地址高4位
LCD_Write_Byte(0,x&0x0f); //设置列地址低4位
}
void LCD_Clr() //清屏函数
{
u8 i,j;
for(i=0;i<9;i++)
{
LCD_Coor(0,i);
for(j=0;j<132;j++)
{
LCD_Write_Byte(1,0x00);
}
}
}
void LCD_UC1705_Init()
{
LCD_Reset();
delay_ms(20);
LCD_Write_Byte(0,0xE2); ////软件复位
delay_ms(20);
//--表格第8个命令,0xA0段(左右)方向选择正常方向(0xA1为反方向)--//
LCD_Write_Byte(0,0xA0); //ADC select segment direction
delay_ms(20);
//--表格第15个命令,0xC8普通(上下)方向选择选择反向,0xC0为正常方向--//
LCD_Write_Byte(0,0xC8); //Common direction
delay_ms(20);
//--表格第9个命令,0xA6为设置字体为黑色,背景为白色---//
//--0xA7为设置字体为白色,背景为黑色---//
LCD_Write_Byte(0,0xA2); // //reverse display
delay_ms(20);
//--表格第10个命令,0xA4像素正常显示,0xA5像素全开--//
LCD_Write_Byte(0,0xA4); // //normal display
delay_ms(20);
//--表格第11个命令,0xA3偏压为1/7,0xA2偏压为1/9--//
LCD_Write_Byte(0,0xA2); //bias set 1/9
delay_ms(20);
//--表格第19个命令,这个是个双字节的命令,0xF800选择增压为4X;--//
//--0xF801,选择增压为5X,其实效果差不多--//
LCD_Write_Byte(0,0xF8); //Boost ratio set
delay_ms(20);
LCD_Write_Byte(0,0x01); //x4
delay_ms(20);
//--表格第18个命令,这个是个双字节命令,高字节为0X81,低字节可以--//
//--选择从0x00到0X3F。用来设置背景光对比度。---/
LCD_Write_Byte(0,0x81); //V0 a set
delay_ms(20);
LCD_Write_Byte(0,0x1C); //
delay_ms(20);
//--表格第17个命令,选择调节电阻率--//
LCD_Write_Byte(0,0x25); //Ra/Rb set
delay_ms(20);
LCD_Write_Byte(0,0x2F); //--表格第16个命令,电源设置。--//
delay_ms(20);
LCD_Write_Byte(0,0x40); //起始行从第一行开始
delay_ms(20);
//LCD_Write_Byte(0,0xB0);
delay_ms(20);
//LCD_Write_Byte(0,0x10);
delay_ms(20);
//LCD_Write_Byte(0,0x00);
delay_ms(20);
LCD_Write_Byte(0,0xAF); //显示开
delay_ms(20);
//
LCD_Clr();
}
/****************************************************************************/
//函数名称:Disp_Dat(uchar Row,uchar Col,uchar Number,uchar fs)
//函数功能:将显示数据输出到屏幕指定位置显示
//输入参数:low 行地址
//输入参数:Col 列地址
//输入参数:Number 显示数据
//输入参数:fs 显示方式(0,反显,否则正常显示)
//返 回 值:无
/****************************************************************************/
void Disp_Dat(u8 Row,u8 Col,u8 Number,u8 fs)
{
u8 L_H,L_L; //列
u8 Page; //页
//计算页地址
Page=0xb0+Row;
L_H=0x10+(Col>>4);
L_L=(Col&0x0f);
LCD_Write_Byte(0,Page);
LCD_Write_Byte(0,0x1f&L_H); //列地址,高低字节两次写入,从第0 列开始
LCD_Write_Byte(0,L_L);
if(fs==0)
{
LCD_Write_Byte(1,~Number);
}
else
{
LCD_Write_Byte(1,Number);
}
}
/****************************************************************************/
//函数名称:Disp_Nub8X16(uchar Row,uchar Col,uchar Number,uchar fs)
//函数功能:将25x48点阵数值输出到屏幕指定位置显示
//输入参数:low 行地址
//输入参数:Col 列地址
//输入参数:Number 显示数值
//输入参数:fs 显示方式(0,反显,否则正常显示)
//返 回 值:无
/****************************************************************************/
void Disp_Nub8X16(u8 Row,u8 Col,u8 Number,u8 fs)
{
u8 i,j;
u8 Temp;
const u8 *STR_p;
STR_p=&Number8X16[Number*16];
for(i=0;i<2;i++)
{
for(j=Col;j<Col+8;j++)
{
//Temp=pgm_read_byte(STR_p);//
Temp=*STR_p;
Disp_Dat(Row,j,Temp,fs);
STR_p++;
}
Row++;
}
}
/****************************************************************************/
//函数名称:Disp_Nub16X16(uchar Row,uchar Col,uchar Number,uchar fs)
//函数功能:将16x16点阵数值输出到屏幕指定位置显示
//输入参数:low 行地址
//输入参数:Col 列地址
//输入参数:Number 显示数值
//输入参数:fs 显示方式(0,反显,否则正常显示)
//返 回 值:无
/****************************************************************************/
void Disp_Nub16X16(u8 Row,u8 Col,u8 Number,u8 fs)
{
u8 i,j;
u8 Temp;
const u8 *STR_p;
STR_p=&Number16X16[Number*32];
for(i=0;i<2;i++)
{
for(j=Col;j<Col+16;j++)
{
Temp=*STR_p;
Disp_Dat(Row,j,Temp,fs);
STR_p++;
}
Row++;
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。