首页资源分类嵌入式开发51内核 > st7567 51代码

st7567 51代码

已有 451559个资源

下载专区

上传者其他资源

文档信息举报收藏

标    签:st7567

分    享:

文档简介

本pdf是51写的st7567驱动程序

文档预览

#include #include #define uchar unsigned char #define uint unsigned int /* sbit RS= P3^5;//指令/数据选择信号 sbit RES= P3^4;//复位信号 sbit W_R= P3^1;//写信号 sbit R_D= P3^0;//读信号 sbit CS= P3^7;//片选 */ /****************Serial*************************/ sbit RS= P1^2;//指令/数据选择信号 sbit RES= P1^1;//复位信号 sbit SCK= P1^3; sbit SDA= P1^4; sbit CS= P1^0;//片选 /**********************************************/ uchar Page = 0xb0 ; /*1 23456789 10 11 12 13 14 15 16 */ unsigned char code Number[][16]= {0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, //0 0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00, //1 0x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00, //2 0x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00,0x00,0x18,0x20,0x20,0x20,0x11,0x0E,0x00, //3 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, //4 0x00,0xF8,0x08,0x88,0x88,0x08,0x08,0x00,0x00,0x19,0x21,0x20,0x20,0x11,0x0E,0x00, //5 0xFE,0xFE,0x26,0x26,0x26,0x26,0xFE,0xFE,0x1B,0x1B,0x1B,0xFF,0xFF,0x1B,0x1B,0x1B, //6 0x00,0x38,0x08,0x08,0xC8,0x38,0x08,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00, //7 0x00,0x70,0x88,0x08,0x08,0x88,0x70,0x00,0x00,0x1C,0x22,0x21,0x21,0x22,0x1C,0x00, //8 0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x00,0x31,0x22,0x22,0x11,0x0F,0x00, //9 0x00,0x00,0xC0,0x38,0xE0,0x00,0x00,0x00,0x20,0x3C,0x23,0x02,0x02,0x27,0x38,0x20, //A 1 0x08,0xF8,0x88,0x88,0x88,0x70,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x11,0x0E,0x00, //B 2 0xC0,0x30,0x08,0x08,0x08,0x08,0x38,0x00,0x07,0x18,0x20,0x20,0x20,0x10,0x08,0x00, //C 3 0x08,0xF8,0x08,0x08,0x08,0x10,0xE0,0x00,0x20,0x3F,0x20,0x20,0x20,0x10,0x0F,0x00, //D 4 0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x20,0x23,0x20,0x18,0x00, //E 5 0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x00,0x03,0x00,0x00,0x00, //F 6 0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x19,0x24,0x22,0x22,0x22,0x3F,0x20, //a 27 0x08,0xF8,0x00,0x80,0x80,0x00,0x00,0x00,0x00,0x3F,0x11,0x20,0x20,0x11,0x0E,0x00, //b 28 0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00,0x00,0x0E,0x11,0x20,0x20,0x20,0x11,0x00, //c 29 0x00,0x00,0x00,0x80,0x80,0x88,0xF8,0x00,0x00,0x0E,0x11,0x20,0x20,0x10,0x3F,0x20, //d 30 0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x22,0x22,0x22,0x22,0x13,0x00, //e 31 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff }; //f 32 unsigned char code pJH[]= { /*-- 调入了一幅图像:C:\Documents and Settings\wjg\桌面\128X64 图片 2.bmp --*/ /*-- 宽度 x 高度=128x64 --*/ 0xFF,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0xFF, 0xFF,0x00,0x00,0x00,0x90,0xF0,0xF8,0xF8,0xF0,0x90,0x00,0x00,0xF8,0xFC,0x04,0x04, 0xFC,0xF8,0x00,0x00,0x00,0x00,0x7C,0xFC,0x80,0x00,0x00,0x00,0xF8,0xFC,0xC4,0x84, 0xFC,0x78,0x00,0x00,0xCC,0xEC,0x24,0x6C,0xF8,0xF0,0x00,0x40,0x40,0x40,0x40,0x40, 0x40,0x40,0x00,0x00,0x38,0xFC,0xC4,0xC4,0xFC,0x38,0x00,0x00,0x08,0x0C,0x84,0x84, 0xFC,0x78,0x00,0x00,0x00,0x04,0xFC,0xFC,0x04,0x00,0x00,0x00,0xF8,0xFC,0x04,0x04, 0xFC,0xF8,0x00,0x00,0xF8,0xFC,0xC4,0x84,0xFC,0x78,0x00,0x00,0xCC,0xEC,0x24,0x6C, 0xF8,0xF0,0x00,0x00,0xF8,0xFC,0xC4,0x84,0xFC,0x78,0x00,0x00,0x00,0x04,0xFC,0xFC, 0x04,0x00,0x00,0x00,0x90,0xF0,0xF8,0xF8,0xF0,0x90,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0x00,0x00,0x80,0x80,0x80,0x81,0x01,0x00,0x00,0x00,0x80,0x83,0x87,0x84,0x84, 0x87,0x83,0x80,0x00,0x86,0x86,0x84,0x87,0x87,0x84,0x00,0x80,0x81,0x83,0x86,0x04, 0x86,0x86,0x80,0x00,0x03,0x07,0x04,0x04,0x07,0x03,0x00,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x00,0x00,0x03,0x87,0x84,0x84,0x87,0x03,0x00,0x80,0x82,0x86,0x84,0x84, 0x07,0x03,0x00,0x00,0x00,0x02,0x07,0x07,0x00,0x00,0x00,0x00,0x03,0x87,0x84,0x84, 0x87,0x03,0x00,0x00,0x01,0x83,0x86,0x84,0x06,0x06,0x00,0x00,0x03,0x07,0xC4,0xC4, 0x07,0x03,0x00,0x80,0x81,0x83,0x86,0x84,0x86,0x86,0x00,0x00,0x00,0x82,0x87,0x87, 0x80,0x00,0x00,0x80,0x80,0x80,0x81,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0x00,0x00,0x80,0xFF,0xFF,0x88,0x9C,0xDC,0xC0,0x00,0x00,0x03,0x3F,0xFC,0xFC, 0x3F,0x03,0x00,0x00,0x80,0x80,0xFF,0xFF,0x80,0x80,0x00,0x80,0xFF,0xFF,0x98,0x9E, 0xF7,0x61,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xFF,0xFF,0x80,0x00, 0x01,0x01,0x00,0x3E,0x7F,0xC1,0x80,0x80,0xC1,0xC1,0x00,0x80,0xFF,0xFF,0x80,0xC1, 0x7F,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x7F,0xC1,0x80,0x80, 0xC1,0xC1,0x00,0x3E,0x7F,0xC1,0x80,0xC1,0x7F,0x3E,0x00,0x00,0x00,0x00,0x10,0x10, 0x00,0x00,0x00,0x80,0xFF,0xFF,0x80,0x00,0x01,0x01,0x00,0x00,0xC0,0xC0,0xFF,0xFF, 0xC0,0xC0,0x00,0x80,0xFF,0xFF,0x80,0xC1,0x7F,0x3E,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xC0,0xE0,0xE0,0x60, 0x70,0x70,0x30,0x38,0x38,0x38,0x38,0x78,0xF8,0xF8,0xF8,0x98,0x18,0x18,0x18,0x18, 0x18,0x18,0x18,0x38,0x38,0x38,0x38,0x30,0x70,0x70,0x70,0xE0,0xE0,0xC0,0xC0,0x80, 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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,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,0x00,0x00,0x00,0x00,0x7C,0xFE,0xEF,0x87,0x03,0x01,0x00,0x00,0x00, 0x00,0x00,0x18,0x30,0x70,0xF0,0xF0,0xF0,0xF3,0xFF,0xFF,0xFF,0xFC,0xF0,0xF0,0x70, 0x70,0x70,0x70,0x70,0x70,0x70,0x60,0x40,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x83, 0xC7,0xFE,0xFC,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,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,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x03,0x07,0x6E,0xFE,0xFC,0xFC, 0xFE,0x3E,0x3F,0x3F,0x37,0x33,0x73,0x71,0x71,0x70,0x70,0x77,0x7F,0xFF,0xFF,0xFC, 0xF0,0x70,0x70,0x70,0x30,0x30,0x38,0x38,0x38,0x18,0x1C,0x1C,0x0E,0x0E,0x07,0x03, 0x03,0x01,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x81,0x81,0x83, 0x87,0x8F,0x8E,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9E,0x9E,0x9F,0x9F, 0x9F,0x9F,0x9E,0x8F,0x8F,0x8F,0x8E,0x8C,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xFF }; unsigned char code pJH1[]= { /*-- 调入了一幅图像:C:\Documents and Settings\wjg\桌面\128X64 图片 1.bmp --*/ /*-- 宽度 x 高度=128x64 --*/ 0xFF,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0xFF, 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0xFA,0x32,0x22,0x62,0xC6,0x84,0x0C,0x38, 0xF0,0xD0,0x1C,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0xBF,0xBF, 0xA4,0xA4,0xA4,0xA4,0xFE,0x7E,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x0E,0x6E, 0x6A,0x6A,0x6A,0x6A,0x6A,0xFF,0xBF,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x08, 0x18,0x10,0xB0,0xA2,0x63,0xFF,0xFE,0xC0,0xE0,0xB8,0x18,0x0C,0x0C,0x00,0x00,0x00, 0x00,0x02,0x06,0x0D,0x39,0xF1,0xC3,0x82,0xE6,0x7C,0x18,0x7C,0xE4,0x86,0x02,0x02, 0x02,0x00,0x00,0x00,0x06,0x1E,0xF8,0xE0,0x40,0x7F,0xFF,0xE6,0x74,0x5C,0xDC,0xF4, 0x66,0x62,0x42,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x7F,0x00,0x20,0x30,0x1C,0x0C,0x00,0x00, 0x7F,0x7F,0x40,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x0F,0x7F,0x70,0x54,0x14,0x14, 0x94,0xF4,0x74,0x14,0x15,0x15,0x34,0x20,0x00,0x00,0x00,0x00,0x09,0x09,0x4B,0x6F, 0x6D,0x89,0xEF,0x6F,0x1B,0x3F,0x6F,0x4B,0x19,0x11,0x11,0x00,0x00,0x00,0x00,0x08, 0x0A,0x0B,0x0B,0x09,0x08,0x7F,0x7F,0x0B,0x48,0x69,0x2B,0x1A,0x10,0x00,0x00,0x00, 0x00,0x00,0x0C,0x7C,0x74,0x04,0x1F,0x7F,0x65,0x05,0x45,0x45,0x65,0x65,0x0D,0x08, 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x7F,0x49,0x49,0x4F,0x4F,0x49,0x49,0x4F,0x4F, 0x7B,0x7A,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0xF4,0x64,0x44,0xC4,0x8C,0x08,0x18,0x70, 0xE0,0xA0,0x38,0x18,0x00,0x00,0x00,0x00,0x04,0x1C,0xF8,0xE2,0x02,0xE6,0xE4,0x0C, 0x78,0xF0,0x90,0x18,0xE8,0xEC,0x0C,0x00,0x00,0x00,0x00,0x00,0x04,0x0C,0xEC,0xEC, 0xAC,0xAC,0xFC,0xFC,0xAC,0xAC,0xEC,0xFC,0x14,0x04,0x04,0x00,0x00,0x00,0x10,0x10, 0x30,0x20,0x60,0x44,0xC6,0xFE,0xFC,0x80,0xC0,0x70,0x30,0x18,0x18,0x00,0x00,0x00, 0x00,0x00,0x04,0x04,0x84,0x84,0x84,0x84,0xFC,0xFC,0x84,0x84,0x84,0x84,0x04,0x04, 0x04,0x00,0x00,0x00,0x40,0xC0,0x80,0xFE,0xFE,0x00,0x40,0x44,0x44,0xFE,0xFE,0x40, 0x40,0xC0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x40,0x60,0x39,0x19,0x00,0x00, 0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x7F,0x7E,0x57,0x57,0x52, 0x7E,0xFF,0x93,0x92,0x97,0x97,0x10,0x10,0x00,0x00,0x00,0x00,0x04,0x0C,0xFF,0xF7, 0xA6,0xA6,0xA7,0xA7,0xA6,0xA6,0xF7,0xF7,0x04,0x0C,0x08,0x00,0x00,0x00,0x00,0x10, 0x14,0x16,0x17,0x13,0x10,0xFF,0xFF,0x17,0x91,0xD3,0x56,0x34,0x20,0x00,0x00,0x00, 0x00,0x01,0x07,0x1E,0xF8,0xE8,0x08,0x08,0xFF,0xFF,0x08,0x08,0x08,0x19,0x11,0x10, 0x00,0x00,0x00,0x00,0x40,0x40,0x41,0x47,0x4F,0x78,0xF8,0xC8,0x48,0x4B,0x4B,0x4E, 0x4C,0x48,0x48,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,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,0x00,0x01,0x01,0x00,0x00,0x00,0x40,0xC0,0xC0,0x40,0x00,0x00,0x00, 0x00,0x00,0x00,0x40,0xC0,0xC0,0x40,0x00,0x00,0x40,0xC0,0xC0,0x40,0x00,0x00,0x40, 0x40,0xC0,0xC0,0x40,0x40,0x00,0x00,0x40,0xC0,0xC0,0x40,0x00,0x00,0xC0,0xC0,0x40, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x10,0x10,0x7C,0x7C, 0x80,0x80,0x00,0x00,0x01,0x0F,0x7E,0xF4,0xF4,0x7E,0x0F,0x01,0x00,0x00,0x00,0x00, 0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x10,0x1C,0x1F,0xF3,0xE0,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x81,0x81,0x81, 0x81,0x80,0x80,0x80,0x80,0x80,0x80,0x81,0x81,0x80,0x80,0x80,0x80,0x80,0x80,0x81, 0x81,0x81,0x81,0x81,0x81,0x80,0x80,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xFF }; void delay(uint ms) { uchar j; while(ms--) for(j=0;j<=20;j++); //  20us=0.02ms// } /************Serial*************/ void WrateC(uchar com) { unsigned char data i,j; CS=0; RS=0; SCK=0; for(i=0;i<8;i++) { j=com; SCK=0; SDA=com&0x80; SCK=1; com=j<<1; } CS=1; RS=1; } void WrateD(uchar dat) { unsigned char data i,j; CS=0; RS=1; SCK=0; for(i=0;i<8;i++) { j=dat; SCK=0; SDA=dat&0x80; SCK=1; dat=j<<1; } CS=1; RS=0; } void ClearDisplay(uchar *P) { // page=0x80; unsigned char i,j; for(i=0xb0;i<0xB8;i++) { WrateC(i); WrateC(0x00); WrateC(0x10); for(j=0;j<128;j++) { WrateD(*P++); } } delay(10000); } // (Page = 0xB0)//设置位置 //发送数据 void LcdInit() { RES=1; delay(50);//最少 2um RES=0; delay(20); RES=1; delay(20); WrateC(0xe2);//软件复位 WrateC(0xA3);//Bais set 显示偏压 WrateC(0xA0);//ADC seg 镜像选择 0xa0 正常,0xA1 左右镜像 WrateC(0xc0);//com output scan direction,com 镜像选择 0xc0 正常,0xC8 上下镜像 /****Select internal resistor ratio****/ WrateC(0x2c);//内部电源管理, WrateC(0x2e);//三条指令间隔时间 2um WrateC(0x2F);// /**************************************/ WrateC(0x81);//电压模式选择 WrateC(0x1d);//电压调整寄存器低位 范围:0x00-0x3f WrateC(0x24);//电压调整寄存器高位 范围:0x21-0x27 ,值越大,显示效果越浓(底影 越浓) WrateC(0xAF);//显示开 WrateC(0x40);//从首行开始显示 //ClearDisplay(); } void Setadd(uchar xl,uchar yl) { uchar i; i=xl&0x0f; xl=(xl>>4)+0x10; WrateC(0xb0+yl); WrateC(xl); WrateC(i); } void ShowOneDig(uchar col,uchar pag,uchar d) { { uchar i = 0 ; uchar j; if(col==0x80) { col=0; pag+=1; } Setadd(col,pag); for(j=0;j<8;j++) { WrateD(Number[d][i++]); } pag++; Setadd(col,pag); for(j=0;j<8;j++) { WrateD(Number[d][i++]); } pag++; } delay(10000); } //-------------------------------------------- void main() { LcdInit(); while(1) { //unsigned char a = 0 ; ClearDisplay(pJH); ClearDisplay(pJH1); /* ShowOneDig(3,0,0); 表示"查表"第*行 LcdInit(); ShowOneDig(10,0,1); //开始数字是 SEG 起始线,中间数字表示 page 第*页,后面数字 LcdInit(); ShowOneDig(17,0,2); LcdInit(); ShowOneDig(24,0,3); LcdInit(); ShowOneDig(31,0,4); LcdInit(); ShowOneDig(38,0,5); LcdInit(); ShowOneDig(45,0,6); LcdInit(); ShowOneDig(52,0,7); ShowOneDig(59,0,0); 表示"查表"第*行 ShowOneDig(63,0,1); ShowOneDig(70,0,2); ShowOneDig(77,0,3); ShowOneDig(84,0,4); ShowOneDig(91,0,5); ShowOneDig(98,0,6); ShowOneDig(105,0,7); ShowOneDig(112,0,2); ShowOneDig(119,0,3); ShowOneDig(127,0,4); //开始数字是 SEG 起始线,中间数字表示 page 第*页,后面数字 //ShowOneDig(88,3,9); */ } }

Top_arrow
回到顶部
EEWORLD下载中心所有资源均来自网友分享,如有侵权,请发送举报邮件到客服邮箱bbs_service@eeworld.com.cn 或通过站内短信息或QQ:273568022联系管理员 高进,我们会尽快处理。