4、吴鉴鹰单片机实战项目精讲(连载)之摇摇棒的制作(二)——源程序介绍
/******************************************************
*程序:摇摇棒的设计程序
** 这一讲的主要内容: 吴鉴鹰摇摇棒的设计和制作
** 功能描述:
** 输 入:
** 内容:
** 输 出:
**
** 全局变量:
** 调用模块:
**
** 作 者: 吴鉴鹰
** 日 期: 14.02.22
备注:有什么错误的地方,欢迎各大烧友指正
O(∩_∩)O~
*******************************************************/
#include <AT89X52.h>
#define uchar unsigned char
#define uint unsigned int //宏定义
#define KEY P3_7 //定义画面切换按键
uchar KY; //KY作用在后面说明
uchar disp; //显示汉字指针
uchar pic=0,num=0; //pic为按键次数;num为中断次数
uchar code love[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x3F,0x00,0x20,0x00,0x20,0x00,0x20,
0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x0F,
0x04,0x10,0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x04,0x10,0xF8,0x0F,0x00,0x00,
0x00,0x00,0x00,0x00,0xFE,0x07,0x00,0x08,0x00,0x10,0x00,0x20,0x00,0x20,0x00,0x10,
0x00,0x08,0xFE,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x3F,0x82,0x20,0x82,0x20,
0x82,0x20,0x82,0x20,0x82,0x20,0x82,0x20,0x82,0x20,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*LOVE*/
};
uchar code loveyou[] = {
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,
0x78,0x00,0xFC,0x00,0xFE,0x01,0xFE,0x03,0xFE,0x07,0xFE,0x0F,0xFE,0x1F,0xFC,0x3F,
0xF8,0x7F,0xFC,0x3F,0xFE,0x1F,0xFE,0x0F,0xFE,0x07,0xFE,0x03,0xFE,0x01,0xFC,0x00,
0x78,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,/*心形图案*/
};
uchar code hehe[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x01,0x40,0x01,0xC0,0x01,0x00,0x00,0x00,0x00,
0xF0,0x0F,0x08,0x10,0x04,0x20,0x00,0x00,0x00,0x00,0xF0,0x3F,0x08,0x00,0x04,0x00,
0x04,0x00,0x04,0x00,0x08,0x00,0xF0,0x3F,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x20,
0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x00,0x00,0x00,0xF0,0x3F,0x08,0x00,0x04,0x00,
0x04,0x00,0x04,0x00,0x08,0x00,0xF0,0x3F,0x00,0x00,0x00,0x00,0x04,0x20,0x08,0x10,
0xF0,0x0F,0x00,0x00,0x00,0x00,0xC0,0x01,0x40,0x01,0xC0,0x01,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*呵呵o(∩_∩)o图案*/
};
unsigned char code hanzi[] = {
/*-- 文字: 欢 --*/
/*-- 楷体_GB231212; 此字体下对应的点阵为:宽x高=16x16 --*/
//0x04,0x24,0x44,0x84,0x64,0x9C,0x40,0x30,0x0F,0xC8,0x08,0x08,0x28,0x18,0x00,0x00,
//0x10,0x08,0x06,0x01,0x82,0x4C,0x20,0x18,0x06,0x01,0x06,0x18,0x20,0x40,0x80,0x00,
/*-- 文字: 迎 --*/
/*-- 楷体_GB231212; 此字体下对应的点阵为:宽x高=16x16 --*/
//0x40,0x40,0x42,0xCC,0x00,0x00,0xFC,0x04,0x02,0x00,0xFC,0x04,0x04,0xFC,0x00,0x00,
//0x00,0x40,0x20,0x1F,0x20,0x40,0x4F,0x44,0x42,0x40,0x7F,0x42,0x44,0x43,0x40,0x00,
/*-- 文字: 使 --*/
/*-- 楷体_GB231212; 此字体下对应的点阵为:宽x高=16x16 --*/
//0x80,0x60,0xF8,0x07,0x04,0xE4,0x24,0x24,0x24,0xFF,0x24,0x24,0x24,0xE4,0x04,0x00,
//0x00,0x00,0xFF,0x00,0x80,0x81,0x45,0x29,0x11,0x2F,0x41,0x41,0x81,0x81,0x80,0x00,
/*-- 文字: 用 --*/
/*-- 楷体_GB231212; 此字体下对应的点阵为:宽x高=16x16 --*/
//0x00,0x00,0xFE,0x22,0x22,0x22,0x22,0xFE,0x22,0x22,0x22,0x22,0xFE,0x00,0x00,0x00,
//0x80,0x60,0x1F,0x02,0x02,0x02,0x02,0x7F,0x02,0x02,0x42,0x82,0x7F,0x00,0x00,0x00,
/*-- 文字: 吴 --*/
/*-- 楷体_GB231212; 此字体下对应的点阵为:宽x高=16x16 --*/
//0x00,0x00,0x80,0x9E,0x92,0x92,0x92,0x92,0x92,0x92,0x92,0x9E,0x80,0x00,0x00,0x00,
//0x84,0x84,0x44,0x44,0x24,0x14,0x0C,0x07,0x0C,0x14,0x24,0x44,0x44,0x84,0x84,0x00,
/*-- 文字: 鉴 --*/
/*-- 楷体_GB231212; 此字体下对应的点阵为:宽x高=16x16 --*/
//0x00,0x00,0x3E,0x00,0x80,0xBF,0x40,0x20,0x58,0x87,0x84,0x0C,0x34,0x04,0x00,0x00,
//0x02,0x42,0x49,0x49,0x5A,0x6A,0x4A,0x7E,0x4A,0x6A,0x5A,0x49,0x49,0x42,0x02,0x00,
/*-- 文字: 鹰 --*/
/*-- 楷体_GB231212; 此字体下对应的点阵为:宽x高=16x16 --*/
//0x00,0x00,0xFE,0x22,0x12,0xFA,0x26,0x12,0xFB,0xAE,0xAA,0xFE,0xAA,0xAA,0x02,0x00,
//0x40,0x30,0x0F,0x40,0x40,0x5E,0x52,0x53,0x56,0x52,0x1A,0x56,0x90,0x70,0x00,0x00,
/*-- 文字: 的 --*/
/*-- 楷体_GB231212; 此字体下对应的点阵为:宽x高=16x16 --*/
//0x00,0xF8,0x0C,0x0B,0x08,0x08,0xF8,0x40,0x30,0x8F,0x08,0x08,0x08,0xF8,0x00,0x00,
//0x00,0x7F,0x21,0x21,0x21,0x21,0x7F,0x00,0x00,0x00,0x43,0x80,0x40,0x3F,0x00,0x00,
/*-- 文字: 摇 --*/
/*-- 楷体_GB231212; 此字体下对应的点阵为:宽x高=16x16 --*/
//0x10,0x10,0x10,0xFF,0x90,0x00,0x94,0x64,0x44,0x54,0xE2,0x42,0x63,0x5A,0x00,0x00,
//0x02,0x42,0x81,0x7F,0x00,0x00,0x02,0x7A,0x42,0x42,0x7F,0x42,0x42,0xFA,0x02,0x00,
/*-- 文字: 摇 --*/
/*-- 楷体_GB231212; 此字体下对应的点阵为:宽x高=16x16 --*/
//0x10,0x10,0x10,0xFF,0x90,0x00,0x94,0x64,0x44,0x54,0xE2,0x42,0x63,0x5A,0x00,0x00,
//0x02,0x42,0x81,0x7F,0x00,0x00,0x02,0x7A,0x42,0x42,0x7F,0x42,0x42,0xFA,0x02,0x00,
/*-- 文字: 棒 --*/
/*-- 楷体_GB231212; 此字体下对应的点阵为:宽x高=16x16 --*/
//0x10,0x10,0xD0,0xFF,0x90,0x10,0x44,0x54,0xD4,0x74,0x5F,0x54,0xD4,0x54,0x44,0x00,
//0x04,0x03,0x00,0xFF,0x00,0x01,0x12,0x11,0x14,0x14,0xFF,0x14,0x14,0x11,0x12,0x00,
//就
0x04,0x10,0xE4,0x4B,0x25,0x82,0x26,0x7E,0x24,0x02,0xE4,0x0B,0x04,0x90,0x20,0x6,
0x20,0x1C,0xFF,0x03,0x20,0x00,0xE2,0x3F,0x2C,0x40,0x20,0x40,0x20,0x70,0x00,0x00,/*"就",0*/
/* (16 X 16 , 宋体 ) */
0x00,0x00,0x02,0x02,0xF2,0x82,0x92,0x92,0x92,0x9A,0xFE,0x56,0x92,0x63,0x92,0x22,
0x92,0x32,0xFE,0x4A,0x92,0x46,0x92,0x42,0xF2,0x82,0x02,0x02,0x00,0x00,0x00,0x00,/*"要",1*/
/* (16 X 16 , 宋体 ) */
0x04,0x00,0x04,0xFE,0x04,0x02,0xF4,0x02,0x84,0x12,0xD4,0x3A,0xA5,0x16,0xA6,0x13,
0xA4,0x12,0xD4,0x1A,0x84,0x32,0xF4,0x42,0x04,0x82,0x04,0x7E,0x04,0x00,0x00,0x00,/*"离",2*/
/* (16 X 16 , 宋体 ) */
0x80,0x00,0x82,0x80,0x82,0x40,0x82,0x30,0xFE,0x0F,0x82,0x00,0x82,0x00,0x82,0x00,
0x82,0x00,0x82,0x00,0xFE,0xFF,0x82,0x00,0x82,0x00,0x82,0x00,0x80,0x00,0x00,0x00,/*"开",3*/
/* (16 X 16 , 宋体 ) */
0x80,0x00,0x90,0x80,0x8C,0x80,0x84,0x84,0x84,0x46,0x84,0x49,0xF5,0x28,0x86,0x10,
0x84,0x10,0x84,0x2C,0x84,0x23,0x84,0x40,0x94,0x80,0x8C,0x00,0x80,0x00,0x00,0x00,/*"安",4*/
/* (16 X 16 , 宋体 ) */
0x10,0x01,0x88,0x00,0xC4,0xFF,0x23,0x48,0xAE,0x29,0x68,0x8D,0x2F,0xFB,0x28,0x09,
0xAE,0xAC,0x20,0x48,0xD8,0x37,0x17,0x08,0x10,0x36,0xF0,0x41,0x10,0x80,0x00,0x00,/*"徽",5*/
/* (16 X 16 , 宋体 ) */
0x04,0x20,0x84,0x60,0x84,0x20,0xFC,0x1F,0x84,0x10,0x84,0x10,0x00,0x40,0xFE,0x44,
0x92,0x44,0x92,0x44,0xFE,0x7F,0x92,0x44,0x92,0x44,0xFE,0x44,0x00,0x40,0x00,0x00,/*"理",6*/
/* (16 X 16 , 宋体 ) */
0x00,0x20,0x04,0x20,0x04,0x20,0x04,0x20,0x04,0x20,0x04,0x20,0x04,0x20,0xFC,0x3F,
0x04,0x20,0x04,0x20,0x04,0x20,0x04,0x20,0x04,0x20,0x04,0x20,0x00,0x20,0x00,0x00,/*"工",7*/
/* (16 X 16 , 宋体 ) */
0x20,0x80,0x20,0x80,0x20,0x40,0x20,0x20,0x20,0x10,0x20,0x0C,0x20,0x03,0xFF,0x00,
0x20,0x03,0x20,0x0C,0x20,0x10,0x20,0x20,0x20,0x40,0x20,0x80,0x20,0x80,0x00,0x00,/*"大",8*/
/* (16 X 16 , 宋体 ) */
0x40,0x04,0x30,0x04,0x11,0x04,0x96,0x04,0x90,0x04,0x90,0x44,0x91,0x84,0x96,0x7,
0x90,0x06,0x90,0x05,0x98,0x04,0x14,0x04,0x13,0x04,0x50,0x04,0x30,0x04,0x00,0x00,/*"学",9*/
/* (16 X 16 , 宋体 ) */
0x00,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x40,0x02,0x80,0xE2,0x7F,
0x22,0x00,0x12,0x00,0x0A,0x00,0x06,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"了",10*/
/* (16 X 16 , 宋体 ) */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x7C,0x10,0xFE,0x3B,
0xFE,0x3B,0x7C,0x10,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
unsigned char code dayday[] = {
0x40,0x80,0x40,0x80,0x42,0x40,0x42,0x20,0x42,0x10,0x42,0x0C,0x42,0x03,0xFE,0x00,
0x42,0x03,0x42,0x0C,0x42,0x10,0x42,0x20,0x42,0x40,0x40,0x80,0x40,0x80,0x00,0x00,/*"天",0*/
/* (16 X 16 , 宋体 ) */
0x40,0x80,0x40,0x80,0x42,0x40,0x42,0x20,0x42,0x10,0x42,0x0C,0x42,0x03,0xFE,0x00,
0x42,0x03,0x42,0x0C,0x42,0x10,0x42,0x20,0x42,0x40,0x40,0x80,0x40,0x80,0x00,0x00,/*"天",1*/
/* (16 X 16 , 宋体 ) */
0x80,0x00,0x82,0x80,0x82,0x40,0x82,0x30,0xFE,0x0F,0x82,0x00,0x82,0x00,0x82,0x00,
0x82,0x00,0x82,0x00,0xFE,0xFF,0x82,0x00,0x82,0x00,0x82,0x00,0x80,0x00,0x00,0x00,/*"开",2*/
/* (16 X 16 , 宋体 ) */
0x00,0x10,0x00,0x0C,0x80,0x03,0x00,0x00,0x00,0x00,0xE0,0x3F,0x02,0x40,0x04,0x40,
0x18,0x40,0x00,0x40,0x00,0x40,0x00,0x78,0x40,0x00,0x80,0x01,0x00,0x0E,0x00,0x00,/*"心",3*/
/* (16 X 16 , 宋体 ) */
};
unsigned char code damogu[] = {
0x20,0x80,0x20,0x80,0x20,0x40,0x20,0x20,0x20,0x10,0x20,0x0C,0x20,0x03,0xFF,0x00,
0x20,0x03,0x20,0x0C,0x20,0x10,0x20,0x20,0x20,0x40,0x20,0x80,0x20,0x80,0x00,0x00,/*"大",0*/
/* (16 X 16 , 宋体 ) */
0x10,0x04,0x60,0x04,0x02,0x7C,0x0C,0x03,0xC0,0x80,0x04,0x88,0xE4,0x4B,0xAF,0x2A,
0xA4,0x1A,0xA4,0x0E,0xA4,0x1A,0xAF,0x2A,0xE4,0x4B,0x04,0x88,0x00,0x80,0x00,0x00,/*"漠",1*/
/* (16 X 16 , 宋体 ) */
0x02,0x42,0x02,0x82,0xF2,0x7F,0x8A,0x00,0x46,0x80,0x00,0x60,0xFC,0x1F,0x04,0x00,
0xFC,0x7F,0x04,0x28,0x02,0x10,0xFE,0x61,0x03,0x0E,0x02,0x30,0x00,0x40,0x00,0x00,/*"孤",2*/
/* (16 X 16 , 宋体 ) */
0x00,0x40,0x00,0x30,0xFE,0x0F,0x22,0x40,0x12,0x40,0xFA,0x5E,0x26,0x52,0x12,0x53,
0xFB,0x56,0xAE,0x52,0xAA,0x1A,0xFE,0x56,0xAA,0x90,0xAA,0x70,0x02,0x00,0x00,0x00,/*"鹰",3*/
/* (16 X 16 , 宋体 ) */
};
unsigned char code womenbiye[] = {
0x20,0x00,0x24,0x08,0x24,0x48,0x24,0x84,0xFE,0x7F,0x23,0x02,0x22,0x41,0x20,0x40,
0x20,0x20,0xFF,0x13,0x20,0x0C,0x22,0x14,0x2C,0x22,0xA0,0x41,0x20,0xF8,0x00,0x00,/*"我",0*/
/* (16 X 16 , 宋体 ) */
0x00,0x01,0x80,0x00,0x60,0x00,0xF8,0xFF,0x07,0x00,0x00,0x00,0xF8,0xFF,0x01,0x00,
0x06,0x00,0x00,0x00,0x04,0x00,0x04,0x40,0x04,0x80,0xFC,0x7F,0x00,0x00,0x00,0x00,/*"们",1*/
/* (16 X 16 , 宋体 ) */
0x00,0x04,0x00,0x04,0xFF,0x05,0x88,0x04,0x88,0x04,0x48,0x04,0x48,0x04,0x00,0xFF,
0x7F,0x04,0x88,0x04,0x84,0x04,0x84,0x04,0x82,0x04,0xE0,0x04,0x00,0x04,0x00,0x00,/*"毕",2*/
/* (16 X 16 , 宋体 ) */
0x00,0x40,0x10,0x40,0x60,0x40,0x80,0x43,0x00,0x40,0xFF,0x7F,0x00,0x40,0x00,0x40,
0x00,0x40,0xFF,0x7F,0x00,0x42,0x00,0x41,0xC0,0x40,0x30,0x40,0x00,0x40,0x00,0x00,/*"业",3*/
/* (16 X 16 , 宋体 ) */
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,0xFC,0x0F,0x04,0x04,0xFC,0x0F,0x00,0x00,0x10,0x44,0x10,0x82,0xFF,0x7F,
0x90,0x00,0xC8,0x40,0x09,0x4F,0x0E,0x60,0x08,0x5C,0xE8,0x43,0x08,0x40,0x00,0x00,/*"啦",4*/
/* (16 X 16 , 宋体 ) */
0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x33,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"!",5*/
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,
/* (16 X 16 , 宋体 ) */
};
unsigned char code LiuShiShi[] = {
/*-- 文字: 刘 --*/
/*-- 楷体_GB231212; 此字体下对应的点阵为:宽x高=16x16 --*/
0x08,0x28,0x48,0x89,0x0E,0x88,0x78,0x08,0x08,0x00,0xF8,0x00,0x00,0xFF,0x00,0x00,
0x40,0x20,0x10,0x09,0x06,0x19,0x60,0x00,0x00,0x00,0x0F,0x40,0x80,0x7F,0x00,0x00,
/*-- 文字: 诗 --*/
/*-- 楷体_GB231212; 此字体下对应的点阵为:宽x高=16x16 --*/
0x40,0x40,0x42,0xCC,0x00,0x40,0x48,0x48,0x48,0x7F,0x48,0xC8,0x48,0x48,0x40,0x00,
0x00,0x00,0x00,0x7F,0x20,0x12,0x0A,0x32,0x02,0x42,0x82,0x7F,0x02,0x02,0x02,0x00,
/*-- 文字: 诗 --*/
/*-- 楷体_GB231212; 此字体下对应的点阵为:宽x高=16x16 --*/
0x40,0x40,0x42,0xCC,0x00,0x40,0x48,0x48,0x48,0x7F,0x48,0xC8,0x48,0x48,0x40,0x00,
0x00,0x00,0x00,0x7F,0x20,0x12,0x0A,0x32,0x02,0x42,0x82,0x7F,0x02,0x02,0x02,0x00,
};
unsigned char code Ytzgzj[] = {
{0x00,0x08,0x00,0x04,0x00,0x03,0xE0,0x00,0x00,0x00,0x00,0x40,0x00,0x80,0xFF,0x7F},
{0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x40,0x00,0x80,0x01,0x00,0x0E,0x00,0x00},/*"小",0*/
/* (16 X 16 , 宋体 ) */
0x40,0x00,0x40,0x00,0x42,0x00,0xCC,0x7F,0x00,0x20,0x40,0x12,0x48,0x0A,0x48,0x32,
0x48,0x02,0x7F,0x42,0x48,0x82,0xC8,0x7F,0x48,0x02,0x48,0x02,0x40,0x02,0x00,0x00,/*"诗",1*/
/* (16 X 16 , 宋体 ) */
0x00,0x80,0xFE,0x6F,0x42,0x08,0x42,0x08,0x42,0x28,0xFE,0xCF,0x00,0x00,0x42,0x00,
0xA2,0x2F,0x9E,0xC8,0x82,0x08,0xA2,0x08,0xC2,0x28,0xBE,0xCF,0x00,0x00,0x00,0x00,/*"照",2*/
/* (16 X 16 , 宋体 ) */
0x00,0x80,0xFE,0x7F,0x02,0x00,0xF2,0x7F,0x12,0x21,0x12,0x12,0xF2,0x89,0x00,0x80,
0xF2,0x4F,0x1A,0x20,0x16,0x18,0xD2,0x17,0x12,0x20,0xF2,0x4F,0x02,0x80,0x00,0x00,/*"顾",3*/
/* (16 X 16 , 宋体 ) */
0x10,0x40,0x10,0x22,0xF0,0x15,0x1F,0x08,0x10,0x16,0xF0,0x61,0x00,0x00,0x80,0x00,
0x82,0x40,0x82,0x80,0xE2,0x7F,0x92,0x00,0x8A,0x00,0x86,0x00,0x80,0x00,0x00,0x00,/*"好",4*/
/* (16 X 16 , 宋体 ) */
0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0xFF,0x88,0x44,0x8C,0x44,0x8A,0x44,0x89,0x44,
0x88,0x44,0x88,0x44,0x88,0x44,0xF8,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"自",5*/
/* (16 X 16 , 宋体 ) */
0x00,0x00,0x00,0x00,0x82,0x3F,0x82,0x40,0x82,0x40,0x82,0x40,0x82,0x40,0x82,0x40,
0x82,0x40,0x82,0x40,0x82,0x40,0xFE,0x40,0x00,0x40,0x00,0x78,0x00,0x00,0x00,0x00,/*"己",6*/
/* (16 X 16 , 宋体 ) */
0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x33,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"!",7*/
/* (16 X 16 , 宋体 ) */
};
/*****函数声明*****/
void display1_ltor(void);
void display2_ltor(void);
void display2_rtol(void);
void display3(void);
void display4(void);
void display5(void);
void display6(void);
void display7(void);
void display8(void);
void display9(void);
/******************************************************
*程序:void DelayUs(uint N)
** 功能描述: n(us)延时子程序
** 输 入:
** 内容:
** 输 出:
**
** 全局变量:
** 调用模块:
**
** 作 者: 吴鉴鹰
** 日 期: 14.02.22
备注:有什么错误的地方,欢迎各大烧友指正
O(∩_∩)O~
*******************************************************/
void DelayUs(uint N)
{
uint x;
for(x=0; x<=N;x++);
}
/******************************************************
*程序:void intersvr0(void) interrupt 0
** 功能描述: 中断服务程序
** 输 入:
** 内容:
** 输 出:
**
** 全局变量:
** 调用模块:
**
** 作 者: 吴鉴鹰
** 日 期: 14.02.22
备注:有什么错误的地方,欢迎各大烧友指正
O(∩_∩)O~
*******************************************************/
void intersvr0(void) interrupt 0
{
//;
KY=~KY; //每个摇动来回水银开关会在摆幅两端分别产生下降沿中断,只提取其中一次(从左向右摇才显示)
if(KY==0)
{
num++; //计算中断次数
switch(pic) //选择画面
{
case 0:{display1_ltor();}break;
case 1:{display2_ltor();}break;
case 2:{display3();}break;
case 3:{display4();}break;
case 4:{display5();}break;
case 5:{display6();}break;
case 6:{display7();}break;
case 7:{display8();}break;
case 8:{display9();}break;
default:{display1_ltor();}
}
}
}
/******************************************************
*程序:void display1_ltor(void)
** 功能描述: 显示子程序1(汉字)
** 输 入:
** 内容:
** 输 出:
**
** 全局变量:
** 调用模块:
**
** 作 者: 吴鉴鹰
** 日 期: 14.02.22
备注:有什么错误的地方,欢迎各大烧友指正
O(∩_∩)O~
*******************************************************/
void display1_ltor(void)
{
uchar i;
if(num>10){disp++;num=0;} //12个汉字分为3次显示完(每次显示4个),每中断10次切换
if(disp>2)disp=0;
DelayUs(5200); //此处延时时间依各硬件差别而各不相同,试着调整使得显示内容居中即可
for(i=0;i<64;i++)
{
P0=~hanzi[disp*128+i*2];
P2=~hanzi[disp*128+i*2+1];
DelayUs(100);
}
}
/******************************************************
*程序:void display2_ltor(void)
** 功能描述: 显示子程序2(LOVE)
** 输 入:
** 内容:
** 输 出:
**
** 全局变量:
** 调用模块:
**
** 作 者: 吴鉴鹰
** 日 期: 14.02.22
备注:有什么错误的地方,欢迎各大烧友指正
O(∩_∩)O~
*******************************************************/
void display2_ltor(void)
{
uchar i;
DelayUs(4000);
for(i=0;i<64;i++)
{
P0=~love[i*2];
P2=~love[i*2+1];
DelayUs(140);
}
}
/******************************************************
*程序:void display3(void)
** 功能描述: 显示子程序3(心形图案)
** 输 入:
** 内容:
** 输 出:
**
** 全局变量:
** 调用模块:
**
** 作 者: 吴鉴鹰
** 日 期: 14.02.22
备注:有什么错误的地方,欢迎各大烧友指正
O(∩_∩)O~
*******************************************************/
void display3(void)
{
uchar i;
DelayUs(4000);
for(i=0;i<64;i++)
{
P0=~loveyou[i*2];
P2=~loveyou[i*2+1];
DelayUs(120);
}
}
/******************************************************
*程序:void display4(void)
** 功能描述: 显示子程序4(呵呵o(∩_∩)o图案)
** 输 入:
** 内容:
** 输 出:
**
** 全局变量:
** 调用模块:
**
** 作 者: 吴鉴鹰
** 日 期: 14.02.22
备注:有什么错误的地方,欢迎各大烧友指正
O(∩_∩)O~
*******************************************************/
void display4(void)
{
uchar i;
DelayUs(4000);
for(i=0;i<64;i++)
{
P0=~hehe[i*2];
P2=~hehe[i*2+1];
DelayUs(120);
}
}
/******************************************************
*程序:void display5(void)
** 功能描述: 显示子程序5(天天开心)
** 输 入:
** 内容:
** 输 出:
**
** 全局变量:
** 调用模块:
**
** 作 者: 吴鉴鹰
** 日 期: 14.02.22
备注:有什么错误的地方,欢迎各大烧友指正
O(∩_∩)O~
*******************************************************/
void display5(void)
{
uchar i;
DelayUs(4000);
for(i=0;i<64;i++)
{
P0=~dayday[i*2];
P2=~dayday[i*2+1];
DelayUs(120);
}
}
/******************************************************
*程序:void display6(void)
** 功能描述: 显示子程序6(天天开心)
** 输 入:
** 内容:
** 输 出:
**
** 全局变量:
** 调用模块:
**
** 作 者: 吴鉴鹰
** 日 期: 14.02.22
备注:有什么错误的地方,欢迎各大烧友指正
O(∩_∩)O~
*******************************************************/
void display6(void)
{
uchar i;
DelayUs(4000);
for(i=0;i<64;i++)
{
P0=~damogu[i*2];
P2=~damogu[i*2+1];
DelayUs(120);
}
}
/******************************************************
*程序:void display7(void)
** 功能描述: 显示子程序7(天天开心)
** 输 入:
** 内容:
** 输 出:
**
** 全局变量:
** 调用模块:
**
** 作 者: 吴鉴鹰
** 日 期: 14.02.22
备注:有什么错误的地方,欢迎各大烧友指正
O(∩_∩)O~
*******************************************************/
void display7(void)
{
uchar i;
if(num>10){disp++;num=0;} //8个汉字分为3次显示完(每次显示4个),每中断10次切换
if(disp>1)disp=0;
DelayUs(5200); //此处延时时间依各硬件差别而各不相同,试着调整使得显示内容居中即可
for(i=0;i<64;i++)
{
P0=~womenbiye[disp*128+i*2];
P2=~womenbiye[disp*128+i*2+1];
DelayUs(100);
}
}
/******************************************************
*程序:void display8(void)
** 功能描述: 显示子程序8(天天开心)
** 输 入:
** 内容:
** 输 出:
**
** 全局变量:
** 调用模块:
**
** 作 者: 吴鉴鹰
** 日 期: 14.02.22
备注:有什么错误的地方,欢迎各大烧友指正
O(∩_∩)O~
*******************************************************/
void display8(void)
{
uchar i;
DelayUs(4000);
for(i=0;i<64;i++)
{
P0=~LiuShiShi[i*2];
P2=~LiuShiShi[i*2+1];
DelayUs(120);
}
}
/******************************************************
*程序:void display9(void)
** 功能描述: 小诗照顾好自己
** 输 入:
** 内容:
** 输 出:
**
** 全局变量:
** 调用模块:
**
** 作 者: 吴鉴鹰
** 日 期: 14.02.22
备注:有什么错误的地方,欢迎各大烧友指正
O(∩_∩)O~
*******************************************************/
void display9(void)
{
uchar i;
if(num>10){disp++;num=0;} //8个汉字分为2次显示完(每次显示4个),每中断10次切换
if(disp>1)disp=0;
DelayUs(5200); //此处延时时间依各硬件差别而各不相同,试着调整使得显示内容居中即可
for(i=0;i<64;i++)
{
P0=~Ytzgzj[disp*128+i*2];
P2=~Ytzgzj[disp*128+i*2+1];
DelayUs(100);
}
}
/******************************************************
*程序:void main(void)
** 功能描述: 主函数
** 输 入:
** 内容:
** 输 出:
**
** 全局变量:
** 调用模块:
**
** 作 者: 吴鉴鹰
** 日 期: 14.02.22
备注:有什么错误的地方,欢迎各大烧友指正
O(∩_∩)O~
*******************************************************/
void main(void)
{
IT0=1;
EX0=1;
EA=1; //开中断,下降沿中断
KY=0;
KEY=1;
while(1) //主程序中只检测按键
{
if(KEY==0) //画面切换键按下
{
DelayUs(10000); //按键去抖
if(KEY==0) //这个地方多了一个分号,谢谢 lhxtzlhxtz的提醒!这是我的疏忽,向大家道歉,只能以后发表更多有价值的帖子表示我的歉意了!
pic++;
while(KEY==0);
}
if(pic>8)pic=0;
}
}
/*****END*****/