PIC单片机论坛单片机专区『 PIC单片机编程技术交流 』 → [原创]PIC18F2550 --- LCD128*64玩拼图游戏


  共有61054人关注过本帖树形打印

主题:[原创]PIC18F2550 --- LCD128*64玩拼图游戏

帅哥哟,离线,有人找我吗?
点点滴滴
  1楼 个性首页 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:老师(版主) 帖子:9334 积分:191231 威望:0 精华:25 注册:2007-4-18 17:02:00
[原创]PIC18F2550 --- LCD128*64玩拼图游戏  发帖心情 Post By:2009-5-20 16:22:00

    最新在学PIC18F2550这个单片机,自己焊了个简单的实验板。自从当了版主后一个多月了还没有原创文章出来,,,实现不好意思呀!基实单片机能做东本太多了,,只能你想不到,没有做不到。。

 这是自己焊的PIC18F2550最小系统的板子,用USB 5V供电,外部8M晶振。


图片点击可在新窗口打开查看此主题相关图片如下:
图片点击可在新窗口打开查看

图片点击可在新窗口打开查看此主题相关图片如下:
图片点击可在新窗口打开查看

 

这个大家都眼熟吧,就是我们小时候经常玩FC电视机游戏的手柄。可花了5大洋,加2大洋公车费!


图片点击可在新窗口打开查看此主题相关图片如下:
图片点击可在新窗口打开查看

FC 手柄接口,用公串口刚刚合适。。。


图片点击可在新窗口打开查看此主题相关图片如下:
图片点击可在新窗口打开查看


图片点击可在新窗口打开查看此主题相关图片如下:
图片点击可在新窗口打开查看

这是金鹏的LCD128*64 有中文字库,在这里没有用到,用SPI串口驱动。我定义了1K的显示缓冲数据区。

每次刷新显示缓冲区,再发送到LCD128*64就可以了。


图片点击可在新窗口打开查看此主题相关图片如下:
图片点击可在新窗口打开查看


图片点击可在新窗口打开查看此主题相关图片如下:
图片点击可在新窗口打开查看

这个就是电路图,加上晶振就可以了,5V供电


图片点击可在新窗口打开查看此主题相关图片如下:
图片点击可在新窗口打开查看

 

LCD 数据手册

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:

工项源文件


 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:

/* 项目名称:PIC jlgsaw puzzle
 *
 * 项目简介:PIC18F2550工作于5V@32MHz。调函数库驱动128 *64 LCD
 * 玩图片 拼图游戏,读取FC 手柄方向键数据,控制图片上下左移动。
 * 对每次有效操作次数记录。 现只能实现固定开局。随机开局死局等
 * 在一个版本中改进。
 *
 * 软件版本:V1.00
 * 建造作者:点点滴滴
 * 建造日期:2009年5月15日至2009年5月20日
 * 开发平台:PICC V9.63PL2  MPLAB IDE V8.30
 */

*******************************************************************************************************************************

#include <htc.h>
#include "PIC18F FC.c"

// 熔丝配置
__CONFIG(1, FCMEN & HSPLL & IESODIS & CPUDIV2 & PLLDIV2);
__CONFIG(2, WDTDIS & VREGDIS & BOREN & BORV27 & PWRTEN);
__CONFIG(3, MCLREN & CCP2RB3 & LPT1DIS);

// LED 端口
#define       LED            LATB7
#define       OpenLed()      (LED = 1)
#define       CloseLed()     (LED = 0)

/* 项目名称:port_init
 * 输入参数:无
 * 输出参数:无
 * 功能简介:端口上电初始化
 */
void port_init(void)
{  
    // 配置为数字 I/O
    ADCON1 = 0B00001111;
   
    // 比较器关闭
    CMCON  = 0B00000111;
   
    //         |--------- IN
    //         ||-------- IN
    //         |||------- IN
    //         ||||------ IN
    //         |||||----- IN
    //         ||||||---- IN  DATA
    //         |||||||--- OUT LATCH
    //         ||||||||-- OUT CLOCK
    PORTA  = 0B00000000;
    LATA   = 0B00000000;
    TRISA  = 0B00111100;
   
    //         |--------- OUT LED
    //         ||-------- IN
    //         |||------- IN
    //         ||||------ IN
    //         |||||----- IN
    //         ||||||---- IN
    //         |||||||--- OUT SCK
    //         ||||||||-- IN
    PORTB  = 0B00000000;
    LATB   = 0B00000000;
    TRISB  = 0B01111101;

    //         |--------- OUT SDO
    //         ||-------- IN
    //         |||------- IN
    //         ||||------ IN
    //         |||||----- IN
    //         ||||||---- IN
    //         |||||||--- IN
    //         ||||||||-- IN
    PORTC  = 0B00000000;
    LATC   = 0B00000000;
    TRISC  = 0B01111111;
}

/* 项目名称:power_up_init
 * 输入参数:无
 * 输出参数:无
 * 功能简介:所有模块上电初始化
 */
void power_up_init(void)
{  
    // 端口初始化设置
    port_init();

    // LCD 初始化设置
    lcd12864_spi_init();
}

/* 项目名称:main
 * 输入参数:无
 * 输出参数:无
 * 功能简介:主函数
 */
void main(void)

    // 操作有效更新排序
 volatile U8 update = FALSE;

    // 记录FC 手柄数据
 volatile U8 fc_value;

    // 记录空白图片位置
    volatile U16 addr  = 0;

    // 图片位置交换记录
    volatile U16 temp  = 0;

    // 记录移动操作次数
    volatile U16 count = 0;

    // 移动数据记录
    static   U16 char_count[4];

    // 拼图开局排序
    static U16 bitmap_number[9] =
    {
      2, 0, 1, 6, 7, 4, 5, 3, 8
    };

    // 上电初始化
    power_up_init();

    // 打开指示灯
    OpenLed();
 
 // 显示作者标语
 author_brief();
 
 // 拼图游戏开局
 count_shift_char(char_count, count);
 drawing_entire_screen(bitmap_number, char_count);

    // 循环执行
    while (TRUE)
    {
      // 获取空白图片位置
      addr = access_blank_addr(bitmap_number);

      // 读取FC 手柄数据
      fc_value = fc_read_value(); 

      switch (fc_value & 0x0f)
      {
        // 向上方向键处理
        case FC_UP:

          if (addr <= 5)
          {
            update = TRUE;    
            temp = bitmap_number[addr];
            bitmap_number[addr] = bitmap_number[addr + 3];
            bitmap_number[addr + 3] = temp;
          }
       
          break;
       
        // 向下方向键处理
        case FC_DOWN:

          if (addr >= 3)
          {
            update = TRUE;
            temp = bitmap_number[addr];
            bitmap_number[addr] = bitmap_number[addr - 3];
            bitmap_number[addr - 3] = temp;
          }

          break;

       // 向左方向键处理
        case FC_LEFT:

       if ((addr != 2) && (addr != 5) && (addr != 8))
       {
      update = TRUE;     
            temp = bitmap_number[addr];
         bitmap_number[addr] = bitmap_number[addr + 1];
            bitmap_number[addr + 1] = temp;
          }

          break;
   
        // 向右方向键处理
        case FC_RIGHT:

          if ((addr != 0) && (addr != 3) && (addr != 6))
          {
            update = TRUE; 
            temp = bitmap_number[addr];
            bitmap_number[addr] = bitmap_number[addr - 1];
            bitmap_number[addr - 1] = temp;
           }

          break;

        // 无效按键处理
        default:
          break;
      }

     // 有效操作 更新拼图排序
     if (update == TRUE)
     {
        // 标志清零
        update = FALSE;

        // 移动次数加一
        count++;
       
        // 娄据转换成字符 输出LCD
        count_shift_char(char_count, count);
        drawing_entire_screen(bitmap_number, char_count);

        // 拼图排序检查 显示网址 原地打转
        if (algorithm_achieve(bitmap_number))
        {
          while (TRUE);
        }
     }
    }
}

*******************************************************************************************************************************

/* 项目名称:PIC18F FC
 *
 * 项目简介:PIC18F2550 工作于5V@320MHz。用软件摸拟同步
 * 串口读取FC 手柄按健数据。
 *
 * 软件版本:V1.00
 * 建造作者:点点滴滴
 * 建造日期:2009年5月15日至2009年5月20日
 * 开发平台:PICC V9.63PL2  MPLAB IDE V8.30
 */

#ifndef PIC18FFC_H_
#define PIC18FFC_H_

#include "jigsaw puzzle.c"

// FC port pin
#define FC_CLOCK             LATA0
#define FC_LATCH             LATA1
#define FC_DATA              RA2 

// clock delay
#define CLOCK_TIME           5

// the direction of health
#define FC_UP                0x07
#define FC_DOWN              0x0b
#define FC_LEFT              0x0d
#define FC_RIGHT             0x0e


/* 函数名称:fc_read_value
 * 输入参数:无
 * 输出参数:FC 手柄按键值
 * 功能简介:读取FC 手柄数据
 */
extern U8 fc_read_value(void);

#endif /*PIC18FFC_H_*/

*******************************************************************************************************************************

/* 项目名称:jigsaw puzzle
 *
 * 项目简介:PIC18F2550工作于5V@32MHz。绘制拼图游戏框架,
 * 排序布局,图片的移动,空白图片位置计算,游戏成功检测等。
 * 
 * 软件版本:V1.00
 * 建造作者:点点滴滴
 * 建造日期:2009年5月15日至2009年5月20日
 * 开发平台:PICC V9.63PL2  MPLAB IDE V8.30
 */

#ifndef JIGSAWPUZZLE_H_
#define JIGSAWPUZZLE_H_

#include "LCD12864.c"

// the is blank bitmap addr
#define blank_bitmap         8

#define bitmap_addr(p_addr)  (&array_bitmap[p_addr][0])

#define bmp_length           31
#define bmp_height           14

#define ach_length           95
#define ach_height           44

#define char_addr(p_addr)    (&array_char[p_addr][0])

#define char_length          5
#define char_height          9

static const U8 author[] =
{
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,
    0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,
    0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,
    0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,
    0xC0,0x00,0x00,0x00,0xFE,0x3F,0x0F,0xC0,0x01,0x81,0xF3,0xF8,0x00,0x00,0x00,0x03,
    0xC0,0x00,0x00,0x00,0x63,0x0C,0x18,0xC0,0x07,0x83,0x19,0x8C,0x00,0x00,0x00,0x03,
    0xC0,0x00,0x00,0x00,0x63,0x0C,0x18,0xC0,0x01,0x83,0x19,0xB0,0x00,0x00,0x00,0x03,
    0xC0,0x00,0x00,0x00,0x63,0x0C,0x30,0x00,0x01,0x83,0x19,0xB0,0x00,0x00,0x00,0x03,
    0xC0,0x00,0x00,0x00,0x63,0x0C,0x30,0x00,0x01,0x81,0xB1,0xF0,0x00,0x00,0x00,0x03,
    0xC0,0x00,0x00,0x00,0x7E,0x0C,0x30,0x00,0x01,0x80,0xE1,0xB0,0x00,0x00,0x00,0x03,
    0xC0,0x00,0x00,0x00,0x60,0x0C,0x30,0x00,0x01,0x81,0xB1,0xB0,0x00,0x00,0x00,0x03,
    0xC0,0x00,0x00,0x00,0x60,0x0C,0x30,0x00,0x01,0x83,0x19,0x80,0x00,0x00,0x00,0x03,
    0xC0,0x00,0x00,0x00,0x60,0x0C,0x18,0xC0,0x01,0x83,0x19,0x80,0x00,0x00,0x00,0x03,
    0xC0,0x00,0x00,0x00,0x60,0x0C,0x19,0x80,0x01,0x83,0x19,0x80,0x00,0x00,0x00,0x03,
    0xC0,0x00,0x00,0x00,0xF0,0x3F,0x0F,0x00,0x07,0xE1,0xF3,0xC0,0x00,0x00,0x00,0x03,
    0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,
    0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,
    0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,
    0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,
    0xC0,0x18,0x00,0x00,0x00,0x0C,0xC6,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x03,
    0xC0,0x18,0xCC,0x1F,0xFF,0x86,0x66,0x00,0x07,0x80,0x00,0x00,0x00,0x00,0x00,0x03,
    0xC0,0x18,0x6E,0x19,0x81,0x86,0x66,0x07,0xF6,0xC0,0x00,0x00,0x00,0x00,0x00,0x03,
    0xC0,0x7E,0x78,0x19,0xFD,0x81,0xFF,0xE0,0x36,0xC0,0x03,0xDE,0x30,0x00,0x70,0x03,
    0xC0,0x19,0xFF,0x99,0x99,0x98,0xCC,0x06,0x66,0x00,0x01,0x8C,0xF0,0x00,0xD8,0x03,
    0xC0,0x18,0xCC,0x1B,0xF1,0x8F,0xDF,0xC3,0x7F,0xF0,0x01,0x8C,0x30,0x01,0x8C,0x03,
    0xC0,0x1E,0xCC,0x1E,0x61,0x8F,0xF1,0x81,0xC6,0x00,0x01,0x98,0x30,0x01,0x8C,0x03,
    0xC0,0x1C,0xCC,0x18,0xF9,0x86,0xF3,0x00,0xC6,0x60,0x00,0xD8,0x30,0x01,0x8C,0x03,
    0xC0,0x7B,0xFF,0x9B,0x8F,0x86,0xF3,0x00,0xE3,0xC0,0x00,0xD8,0x30,0x01,0x8C,0x03,
    0xC0,0x18,0xCC,0x1E,0x67,0x86,0xFF,0xE1,0xE3,0x80,0x00,0xF0,0x30,0x01,0x8C,0x03,
    0xC0,0x18,0xCC,0x18,0x31,0x9C,0xF3,0x01,0xB3,0x00,0x00,0xF0,0x30,0x01,0x8C,0x03,
    0xC0,0x18,0xCC,0x18,0xC1,0x8D,0xB3,0x03,0x37,0x80,0x00,0x70,0x30,0x01,0x8C,0x03,
    0xC0,0x19,0x8C,0x18,0x71,0x8D,0xB3,0x06,0x1D,0xB0,0x00,0x60,0x30,0x70,0xD8,0x03,
    0xC0,0x19,0x8C,0x18,0x61,0x8D,0xB3,0x00,0x70,0xF0,0x00,0x60,0xFC,0x70,0x70,0x03,
    0xC0,0x7B,0x0C,0x1F,0xFF,0x8F,0xFF,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x03,
    0xC0,0x36,0x0C,0x18,0x01,0x8C,0x66,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x03,
    0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,
    0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,
    0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,
    0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,
    0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,
    0xC0,0x06,0x60,0x00,0x60,0x00,0x00,0x18,0x00,0x0C,0x01,0x83,0x00,0xC1,0x80,0x03,
    0xC0,0x07,0x60,0x00,0x63,0x00,0x00,0x18,0x00,0x0C,0x00,0xDF,0xF8,0x6F,0xFC,0x03,
    0xC0,0x06,0xC0,0x0F,0xFF,0x80,0x00,0x1F,0xC0,0x0F,0xE0,0xC6,0x60,0x63,0x30,0x03,
    0xC0,0x0D,0xFF,0x80,0x66,0x00,0x00,0x18,0x00,0x0C,0x00,0x03,0xC0,0x01,0xE0,0x03,
    0xC0,0x0D,0xE0,0x00,0x6C,0x00,0x00,0x19,0x80,0x0C,0xC3,0x1F,0xF9,0x8F,0xFC,0x03,
    0xC0,0x1F,0x66,0x1F,0xFF,0xC0,0x01,0xFF,0xC0,0xFF,0xE1,0xF9,0x98,0xFC,0xCC,0x03,
    0xC0,0x3C,0x7F,0x00,0x30,0x03,0x81,0x81,0x80,0xC0,0xC1,0xF9,0x98,0xFC,0xCC,0x03,
    0xC0,0x6C,0x60,0x00,0xE0,0x03,0x81,0x81,0x80,0xC0,0xC0,0x7F,0xF8,0x3F,0xFC,0x03,
    0xC0,0x0C,0x60,0x01,0xFF,0x00,0x01,0x81,0x80,0xC0,0xC0,0xD9,0x98,0x6C,0xCC,0x03,
    0xC0,0x0C,0x63,0x07,0x83,0x00,0x01,0xFF,0x80,0xFF,0xC0,0xDF,0xF8,0x6F,0xFC,0x03,
    0xC0,0x0C,0x7F,0xBD,0x83,0x00,0x01,0x81,0x80,0xC0,0xC0,0xDE,0x78,0x6F,0x3C,0x03,
    0xC0,0x0C,0x60,0x01,0xFF,0x00,0x00,0x19,0x80,0x0C,0xC3,0x9F,0xF9,0xCF,0xFC,0x03,
    0xC0,0x0C,0x60,0x01,0x83,0x03,0x83,0xCC,0xC1,0xE6,0x61,0x98,0x18,0xCC,0x0C,0x03,
    0xC0,0x0C,0x60,0x01,0x83,0x03,0x83,0x66,0x61,0xB3,0x31,0x98,0x18,0xCC,0x0C,0x03,
    0xC0,0x0C,0x60,0x01,0xFF,0x00,0x06,0x66,0x63,0x33,0x31,0x98,0x78,0xCC,0x3C,0x03,
    0xC0,0x0C,0x60,0x01,0x83,0x00,0x00,0x00,0x00,0x00,0x01,0x98,0x30,0xCC,0x18,0x03,
    0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,
    0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,
    0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,
    0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
};

static const U8 frame[] =
{
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xF0,0x00,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0xE0,0x00,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0xC7,0xFF,0xFF,0x8C,0x19,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x88,0x00,0x00,0x44,0xE3,0xEF,0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x00,0x00,0x24,0x24,0x40,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x00,0x00,0x24,0xFA,0x80,0x3E,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x31,0x86,0x24,0x21,0x0F,0xD2,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x30,0xCC,0x24,0x76,0x82,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x30,0xCC,0x24,0x69,0xE5,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x3C,0xDB,0x24,0xA2,0x28,0x92,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x91,0xFF,0xFE,0x24,0xAD,0x4F,0xA2,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x30,0xCC,0x24,0x21,0x88,0x44,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x30,0xCC,0x24,0x2E,0x00,0x9C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x38,0xCC,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x70,0xCF,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x91,0xF7,0xFE,0x27,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0x91,0xB1,0x8C,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x31,0x8C,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x31,0x8C,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x31,0x8C,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x33,0x0C,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0xF6,0x0C,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x6C,0x0C,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x00,0x00,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x00,0x00,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0xFF,0xFE,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0xCE,0x06,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0xCC,0x06,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0xDF,0xE6,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0xDC,0xC6,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0xF7,0x86,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0xE3,0x06,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0xC7,0x86,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0xDC,0xF6,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0xF7,0x36,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0xE1,0x86,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0xC0,0x06,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0xCF,0x86,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0xC1,0xC6,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0xC0,0x06,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0xFF,0xFE,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x00,0x00,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x00,0x00,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x00,0x00,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x0F,0xC0,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x03,0x00,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x03,0x00,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x03,0x00,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x03,0x00,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x03,0x00,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x03,0x00,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x03,0x00,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x03,0x00,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x03,0x00,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x03,0x00,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x03,0x00,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x0F,0xC0,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x90,0x00,0x00,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0x88,0x00,0x00,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0xC7,0xFF,0xFF,0x8C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0xE0,0x00,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0xF0,0x00,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
};

static const U8 achieve[] =
{
    0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0x40,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x02,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,
    0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x80,0x00,0x70,0x00,
    0x0C,0x07,0x80,0x00,0x00,0x00,0x00,0x02,0x80,0x00,0x70,0x00,0x3C,0x0D,0x80,0x00,
    0x00,0x00,0x00,0x02,0x80,0x00,0x00,0x00,0x0C,0x18,0x00,0x00,0x00,0x00,0x00,0x02,
    0x80,0x00,0x00,0x00,0x0C,0x18,0x00,0x00,0x00,0x00,0x00,0x02,0x83,0xF0,0xF0,0x1E,
    0x0C,0x1F,0x00,0x01,0xE1,0xF3,0xFC,0x02,0x81,0xD8,0x30,0x33,0x0C,0x1D,0x80,0x03,
    0x33,0x19,0xB6,0x02,0x81,0x8C,0x30,0x60,0x0C,0x18,0xC0,0x06,0x03,0x19,0xB6,0x02,
    0x81,0x8C,0x30,0x60,0x0C,0x18,0xC0,0x06,0x03,0x19,0xB6,0x02,0x81,0x8C,0x30,0x60,
    0x0C,0x18,0xC0,0x06,0x03,0x19,0xB6,0x02,0x81,0x98,0x30,0x33,0x0C,0x0D,0x8E,0x03,
    0x33,0x19,0xB6,0x02,0x81,0xF0,0xFC,0x1E,0x3F,0x07,0x0E,0x01,0xE1,0xF3,0xFE,0x02,
    0x81,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x83,0xC0,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x02,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,
    0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x80,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x02,0x80,0x00,0x00,0x60,0x18,0x00,0x01,0x80,0x00,0x00,0x00,0x02,
    0x80,0x00,0x00,0x60,0x0C,0x70,0x01,0xB0,0x00,0x00,0x00,0x02,0x80,0x00,0x7F,0x60,
    0x0F,0xDF,0x83,0x3F,0xE0,0x00,0x00,0x02,0x80,0x00,0x03,0xFF,0x8D,0x99,0x83,0x60,
    0xC0,0x00,0x00,0x02,0x80,0x00,0x63,0xC3,0x01,0x99,0x87,0xCC,0x01,0x80,0x00,0x02,
    0x80,0x00,0x37,0xB6,0x01,0x99,0x87,0x6F,0x01,0x80,0x00,0x02,0x80,0x00,0x1E,0x30,
    0x3D,0x99,0x8F,0x6D,0x81,0x80,0x00,0x02,0x80,0x00,0x0C,0x30,0x0D,0x99,0x9B,0xCC,
    0xC1,0x80,0x00,0x02,0x80,0x00,0x0E,0x30,0x0D,0xF9,0x83,0x3C,0xC1,0x80,0x00,0x02,
    0x80,0x00,0x0E,0x38,0x0D,0xDF,0x83,0x18,0x01,0x80,0x00,0x02,0x80,0x00,0x1B,0x78,
    0x0D,0x9B,0x00,0x00,0x01,0x80,0x00,0x02,0x80,0x00,0x1B,0x6C,0x0C,0x18,0x07,0xB0,
    0xC1,0x80,0x00,0x02,0x80,0x00,0x30,0xCE,0x0C,0x18,0x07,0x9B,0x61,0x80,0x00,0x02,
    0x80,0x00,0x63,0x87,0x9E,0x00,0x0F,0x83,0x60,0x00,0x00,0x02,0x80,0x00,0x1E,0x03,
    0x33,0xFF,0xC0,0xFF,0x01,0x80,0x00,0x02,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x02,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,
    0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x80,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x04,0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,
};

static const U8 array_bitmap[9][56] =
{
    // bmp1
    {
      0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFE,0xFF,0xF8,0xFF,0xFE,0xFF,0xF0,0xFF,0xFE,
      0xFF,0xFC,0xFF,0xFE,0xFF,0xFC,0xFF,0xFE,0xFF,0xFC,0xFF,0xFE,0xFF,0xFC,0xFF,0xFE,
      0xFF,0xFC,0xFF,0xFE,0xFF,0xFC,0xFF,0xFE,0xFF,0xF0,0x3F,0xFE,0xFF,0xF0,0x3F,0xFE,
      0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFE,
    },

    // bmp2
    {
      0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFE,0xFF,0xF8,0x7F,0xFE,0xFF,0xF0,0x3F,0xFE,
      0xFF,0xF7,0x3F,0xFE,0xFF,0xFF,0x3F,0xFE,0xFF,0xFF,0x3F,0xFE,0xFF,0xFE,0x7F,0xFE,
      0xFF,0xFC,0xFF,0xFE,0xFF,0xF9,0xFF,0xFE,0xFF,0xF0,0x3F,0xFE,0xFF,0xF0,0x3F,0xFE,
      0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFE,
    },

    // bmp3
    {
      0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFE,0xFF,0xF8,0x3F,0xFE,0xFF,0xF8,0x1F,0xFE,
      0xFF,0xFB,0x9F,0xFE,0xFF,0xFF,0x9F,0xFE,0xFF,0xFC,0x3F,0xFE,0xFF,0xFC,0x3F,0xFE,
      0xFF,0xFF,0x9F,0xFE,0xFF,0xFB,0x9F,0xFE,0xFF,0xF8,0x1F,0xFE,0xFF,0xF8,0x3F,0xFE,
      0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFE,
    },

    // bmp4
    {
      0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFE,0xFF,0xFC,0x7F,0xFE,0xFF,0xFC,0x7F,0xFE,
      0xFF,0xF8,0x7F,0xFE,0xFF,0xF2,0x7F,0xFE,0xFF,0xF2,0x7F,0xFE,0xFF,0xE6,0x7F,0xFE,
      0xFF,0xE0,0x3F,0xFE,0xFF,0xFE,0x7F,0xFE,0xFF,0xFE,0x7F,0xFE,0xFF,0xFE,0x7F,0xFE,
      0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFE,
    },

    // bmp5
    {
      0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFE,0xFF,0xF0,0x3F,0xFE,0xFF,0xF0,0x3F,0xFE,
      0xFF,0xF3,0xFF,0xFE,0xFF,0xF3,0xFF,0xFE,0xFF,0xF0,0x7F,0xFE,0xFF,0xF0,0x3F,0xFE,
      0xFF,0xFF,0x3F,0xFE,0xFF,0xF7,0x3F,0xFE,0xFF,0xF0,0x3F,0xFE,0xFF,0xF0,0xFF,0xFE,
      0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFE,
    },

    // bmp6
    {
      0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFE,0xFF,0xFC,0x3F,0xFE,0xFF,0xF8,0x3F,0xFE,
      0xFF,0xF9,0xFF,0xFE,0xFF,0xF2,0x3F,0xFE,0xFF,0xF0,0x1F,0xFE,0xFF,0xF3,0x9F,0xFE,
      0xFF,0xF3,0x9F,0xFE,0xFF,0xF3,0x9F,0xFE,0xFF,0xF8,0x3F,0xFE,0xFF,0xFC,0x7F,0xFE,
      0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFE,
    },

    // bmp7
    {
      0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFE,0xFF,0xF0,0x3F,0xFE,0xFF,0xF0,0x3F,0xFE,
      0xFF,0xFF,0x7F,0xFE,0xFF,0xFE,0x7F,0xFE,0xFF,0xFE,0x7F,0xFE,0xFF,0xFE,0xFF,0xFE,
      0xFF,0xFC,0xFF,0xFE,0xFF,0xFC,0xFF,0xFE,0xFF,0xF9,0xFF,0xFE,0xFF,0xF9,0xFF,0xFE,
      0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFE,

     },

    // bmp8
    {
      0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFE,0xFF,0xF8,0x7F,0xFE,0xFF,0xF0,0x3F,0xFE,
      0xFF,0xF3,0x3F,0xFE,0xFF,0xF3,0x3F,0xFE,0xFF,0xF8,0x7F,0xFE,0xFF,0xF8,0x7F,0xFE,
      0xFF,0xF3,0x3F,0xFE,0xFF,0xF3,0x3F,0xFE,0xFF,0xF0,0x3F,0xFE,0xFF,0xF8,0x7F,0xFE,
      0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFE,
    },
       
    // bmp0
    {
      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,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    }
};

static const U8 array_char[10][9] =
{
    // char0
    {
      0x70,0x88,0x88,0x98,0xA8,0xC8,0x88,0x88,0x70,  
    },
  
    // char1
    { 
      0x20,0x60,0x20,0x20,0x20,0x20,0x20,0x20,0x70, 
    },
  
    // char2
    {
      0x70,0x88,0x88,0x08,0x10,0x20,0x40,0x80,0xF8,
    },
  
    // char3
    {
      0x70,0x88,0x08,0x30,0x08,0x08,0x08,0x88,0x70,
    },
  
    // char4
    {
      0x10,0x10,0x30,0x50,0x50,0x90,0xF8,0x10,0x38,  
    },
  
    // char5
    {
      0xF8,0x80,0x80,0xF0,0x88,0x08,0x88,0x88,0x70,   
    },
  
    // char6
    {
      0x38,0x48,0x80,0xB0,0xC8,0x88,0x88,0x88,0x70,  
    },
  
    // char7
    {
      0xF8,0x90,0x10,0x10,0x20,0x20,0x20,0x20,0x20,
    },
  
    // char8
    {
      0x70,0x88,0x88,0x50,0x70,0x88,0x88,0x88,0x70,
    },
  
    // char9
    {
      0x70,0x88,0x88,0x88,0x98,0x68,0x08,0x90,0xE0,  
    }
};


/* 项目名称:drawing_lcd_form
 * 输入参数:无
 * 输出参数:无
 * 功能简介:将窗体图片发送LCD缓冲区
 */
extern void drawing_lcd_form(void);

/* 项目名称:drawing_puzzles
 * 输入参数:拼图排序缓冲区首址
 * 输出参数:无
 * 功能简介:将排序图片发送LCD缓冲区
 */
extern void drawing_puzzles(U16 *p_number);

/* 项目名称:drawing_shift_count
 * 输入参数:移动记录字符缓冲区
 * 输出参数:无
 * 功能简介:将字符缓冲区发送到LCD缓冲区
 */
extern void drawing_shift_count(U16 *p_count);

/* 项目名称:drawing_entire_screen
 * 输入参数:排序缓冲区首址,字符缓冲区首址
 * 输出参数:无
 * 功能简介:绘制一幅完整图片发送到缓冲区,并送到LCD屏
 */
extern void drawing_entire_screen(U16 *p_number
                                 ,U16 *p_count);
/* 项目名称:author_brief
 * 输入参数:无
 * 输出参数:无
 * 功能简介:显示作者的广告语
 */
extern void author_brief(void);

/* 项目名称:count_shift_char
 * 输入参数:字符缓冲区首址,移动次数
 * 输出参数:无
 * 功能简介:将移动次数转换成字符并存入缓冲区
 */
extern void count_shift_char(U16 *p_count, U16 count);

/* 项目名称:access_blank_addr
 * 输入参数:拼图排序缓冲区首址
 * 输出参数:空白图片地址
 * 功能简介:查找空白图片所在的地址
 */
extern int access_blank_addr(U16 *p_number);

/* 项目名称:algorithm_achieve
 * 输入参数:拼图排序缓冲区首址
 * 输出参数:无
 * 功能简介:判断图片全部是否接顺序排列完整
 */
extern U8 algorithm_achieve(U16 *p_number);

#endif /*JIGSAWPUZZLE_H_*/

*******************************************************************************************************************************

/* 项目名称:LCD12864
 *
 * 项目简介:PIC18F2550 工作于5V@32MHz,通过硬件SPI同步串口
 * 控制型号为OCMJ4X8C 128 * 64 单色背光LCD。实现点绘制,可以
 * 绘制定义大小的图片。
 *
 * 软件版本:V1.00
 * 建造作者:点点滴滴
 * 建造日期:2009年5月15日至2009年5月20日
 * 开发平台:PICC V9.63PL2  MPLAB IDE V8.30
 */

/*****************************************************************************/
#ifndef LCD12864_H_
#define LCD12864_H_

// the definition of the type of new
typedef unsigned char U8;
typedef unsigned int  U16;

// conditions of the definition of
#define FALSE 0
#define TRUE  1

// clear display
#define lcd_clear_disp       0x01

// clear address
#define lcd_clear_addr       0x03  

// direction of movement
#define lcd_set_direc        0x06

// show status
#define lcd_set_show         0x0c

// ordinary functional set
#define lcd_ordi_fearu       0x30

// expansion functional set
#define lcd_expa_ferau       0x36

/*****************************************************************************/
// Display buffer
U8 lcd_dis_buffer[64][16] @ 0x400;

// buffer data siae
#define lcd_buff_size        1024

// data Pointer
#define LCD_BUFF             (&lcd_dis_buffer[0][0])

// lcd busy time 50us
#define lcd_busy_time        50

// lcd Largest y
#define lcd_y_max            64

// lcd Largest x
#define lcd_x_max            128

// lcd offset address
#define lcd_addr             128

// buffer data clear
#define clear                0

// buffer data show
#define show                 1

// buffer data anti
#define anti                 2

/*****************************************************************************/

/* 函数名称:lcd12864_spi_init
 * 输入参数:无
 * 输出参数:无
 * 功能简介:SPI模块上电初始化
 */
extern void lcd12864_spi_init(void);

/* 函数名称:write_spi
 * 输入参数:等待发送的数据
 * 输出参数:无
 * 功能简介:SPI发送一字节数据
 */
extern void write_spi(U8 data);

/* 函数名称:set_lcd_run_mode
 * 输入参数:无
 * 输出参数:无
 * 功能简介:LCD上电初始化
 */
extern void set_lcd_run_mode(void);

/* 函数名称:spi_lcd_send_code
 * 输入参数:无
 * 输出参数:无
 * 功能简介:通过SPI向LCD发送指令
 */
extern void spi_lcd_send_code(U8 rs, U8 rw, U8 data);

/* 函数名称:spi_lcd_dis_buffer
 * 输入参数:LCD显示缓冲区首址
 * 输出参数:无
 * 功能简介:将整屏缓冲区数据发送到LCD
 */
extern void spi_lcd_dis_buffer(U8 *p_data);

/* 函数名称:lcd_buff_operation
 * 输入参数:操作类型 0 = 清零 1 = 置位 2 = 取反
 * 输出参数:无
 * 功能简介:操作整屏LCD数据
 */
extern void lcd_buff_operation(U8 type);

/* 函数名称:copy_bitmap_to_buff
 * 输入参数:图片首址,缓冲区首址
 * 输出参数:无
 * 功能简介:将一幅图片数据复制到缓冲区
 */
extern void copy_bitmap_to_buff(const U8 *p_bitmap
                               ,U8 *lcd_buffer);

/* 函数名称:draw_lcd_point
 * 输入参数:LCD坐标参数,操作类型
 * 输出参数:0 = 无效参数 1= 有效参数
 * 功能简介:LCD缓冲区点操作 0 = 清零 1 = 置位 2 = 取反
 */
extern U8 draw_lcd_point(U8 x, U8 y, U8 type);

/* 函数名称:draw_lcd_bitmap
 * 输入参数:图片坐标,长宽,图片首址
 * 输出参数:0 = 无效参数 1= 有效参数
 * 功能简介:将指定坐标,长宽的图片数据发送LCD缓冲区
 */
extern U8 draw_lcd_bitmap(U8 x, U8 x_pixels
                    ,U8 y, U8 y_pixels
                    ,const U8 *p_bitmap);

/*****************************************************************************/
#endif /*LCD12864_H_*/

*******************************************************************************************************************************



成功只垂青于做好准备的人!
[本帖被加为精华]
支持(0中立(1反对(3回到顶部
帅哥哟,离线,有人找我吗?
点点滴滴
  2楼 个性首页 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:老师(版主) 帖子:9334 积分:191231 威望:0 精华:25 注册:2007-4-18 17:02:00
  发帖心情 Post By:2009-5-20 16:28:00

有关FC 手柄读写操作更多详情在这

http://pic16.com/bbs/dispbbs.asp?BoardID=8&ID=31178&replyID=&skin=1

无图无真。。。。这年头流行上视频。。。

联接:http://v.ku6.com/show/YbKMpju9mKgviXMN.html

 

点击开新窗口欣赏该FLASH动画![全屏欣赏]
http://player.ku6.com/refer/YbKMpju9mKgviXMN/v.swf

      陈老大,我在调试这个程序的时候发现一个问题。。用QL-2006在线烧写的时候,单片机运行不正常(提示正常完成)。我也用过这个编程器烧过不少的单片机。没有出现过问题。就是对于PIC18F2550出现问题。后来我用MCD2烧写的时候就正常了。。就因这个让我调试了一整天。。

回头你让工程师详细的对这个型号的单片机进行测试一个。。。我想应该有BUG。

[此贴子已经被作者于2009-5-20 21:39:52编辑过]


成功只垂青于做好准备的人!
支持(0中立(0反对(0回到顶部
帅哥哟,离线,有人找我吗?
陈学乾
  3楼 个性首页 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信 逍遥帮总舵主
等级:校长(管理员) 帖子:11669 积分:247247 威望:1 精华:16 注册:2004-8-17 1:52:00
  发帖心情 Post By:2009-5-20 17:21:00

好的,但是我们自己用的18F2550(PICKIT2用的,前后也写了超过500个了)也全是用QL-2006写的,还没有出现有问题,您用的软件版本是?



愿我们大家一起努力,让本论坛能给更多的朋友给予帮助. http://www.pic16.com
支持(1中立(0反对(2回到顶部
帅哥哟,离线,有人找我吗?
点点滴滴
  4楼 个性首页 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:老师(版主) 帖子:9334 积分:191231 威望:0 精华:25 注册:2007-4-18 17:02:00
  发帖心情 Post By:2009-5-20 17:31:00


图片点击可在新窗口打开查看此主题相关图片如下:
图片点击可在新窗口打开查看


成功只垂青于做好准备的人!
支持(1中立(1反对(0回到顶部
帅哥哟,离线,有人找我吗?
陈学乾
  5楼 个性首页 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信 逍遥帮总舵主
等级:校长(管理员) 帖子:11669 积分:247247 威望:1 精华:16 注册:2004-8-17 1:52:00
  发帖心情 Post By:2009-5-20 17:42:00

这个版本应该是比较新的了,您把HEX文件发给我,我抽空仔细研究一下。

可发到邮箱:cxqmcu小老鼠cxqmcu.com  谢谢!



愿我们大家一起努力,让本论坛能给更多的朋友给予帮助. http://www.pic16.com
支持(1中立(0反对(2回到顶部
帅哥哟,离线,有人找我吗?
点点滴滴
  6楼 个性首页 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:老师(版主) 帖子:9334 积分:191231 威望:0 精华:25 注册:2007-4-18 17:02:00
  发帖心情 Post By:2009-5-20 18:03:00

是哪个文件?如果是我调试用的文件,在楼主位里下载就可以了。。


成功只垂青于做好准备的人!
支持(0中立(3反对(0回到顶部
帅哥哟,离线,有人找我吗?
zhongruntian
  7楼 个性首页 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信 丐帮帮主
等级:老师(版主) 帖子:9899 积分:201298 威望:0 精华:32 注册:2005-3-13 12:01:00
  发帖心情 Post By:2009-5-20 18:11:00

顶了,不过视频好象播放不了。

点版主以后再大概说一下思路就好了,比如这个拼图中,移动1块图片后跟其他图片衔接是怎么处理的。



http://www.cevx.com/bbs/index.php
支持(2中立(0反对(1回到顶部
帅哥哟,离线,有人找我吗?
陈学乾
  8楼 个性首页 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信 逍遥帮总舵主
等级:校长(管理员) 帖子:11669 积分:247247 威望:1 精华:16 注册:2004-8-17 1:52:00
  发帖心情 Post By:2009-5-20 18:19:00

以下是引用点点滴滴在2009-5-20 18:03:00的发言:
是哪个文件?如果是我调试用的文件,在楼主位里下载就可以了。。

好的,已下载。


愿我们大家一起努力,让本论坛能给更多的朋友给予帮助. http://www.pic16.com
支持(0中立(2反对(1回到顶部
帅哥哟,离线,有人找我吗?
点点滴滴
  9楼 个性首页 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:老师(版主) 帖子:9334 积分:191231 威望:0 精华:25 注册:2007-4-18 17:02:00
  发帖心情 Post By:2009-5-20 18:48:00

看不到视频吗,我在不同的电脑都可能看得到的呀。。。大家的都是这样吗?

static U16 bitmap_number[9] =
    {
      2, 0, 1, 6, 7, 4, 5, 3, 8
    };

#define bitmap_addr(p_addr)  (&array_bitmap[p_addr][0])

就通过这个缓冲区和这个宏定义查找图片表格的首址,然后发送到LCD显示缓冲区里,刷屏显示。

按键操作也是分析这个缓冲区内容,而进行操作判断!



成功只垂青于做好准备的人!
支持(1中立(2反对(0回到顶部
帅哥哟,离线,有人找我吗?
zhongruntian
  10楼 个性首页 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信 丐帮帮主
等级:老师(版主) 帖子:9899 积分:201298 威望:0 精华:32 注册:2005-3-13 12:01:00
  发帖心情 Post By:2009-5-21 17:55:00

能看到视频了,呵呵!!



http://www.cevx.com/bbs/index.php
支持(2中立(3反对(0回到顶部
总数 28 1 2 3 下一页
Google 全部 本站