1、今天刚调试通过就挂上来了,大家支持一下,哈哈!!
2、还从中发现一个问题,这个程序用PICC9。65和谐版,就不能编译通过,而用PICC9。5却可以编译通过。
3、PICC9。65报错是因为定义了大数组(可能超2K了,涉及程序空间跨页问题了),就无法编译通过了,而用PICC9。5却没有这个问题,看来PICC9。65和谐版还有一些不尽如人意的地方啦。
4、所以忍痛割爱卸掉了9。65 又装上了PICC9。5,是网友木鱼( QQ: 362862933)帮助发现这一问题,在此表示感谢!!
程序如下:各位可以不防一试(C编译器)
- // A B C D 对应RB0; RB1 ;RB2; RB3//
- //------------------------------//
- //用到了单片机9个端口 RB0-RB7,和RA0//
- //晶振频率使用20MHz。
- //单片机型号为16F877A
- #include "pic.h"
- __CONFIG(HS&WDTEN&PWRTEN&BOREN&LVPDIS&DEBUGDIS&UNPROTECT&WP3);
- #define uchar unsigned char
- #define uint unsigned int
- void Keyscan (void); //修改参数按键扫描子程序
- void Sendping(); //发送半屏子程序
- #define clk RB5
- #define rclk RB4 //锁存用的
- #define red RB6
- #define green RB7 //试验证明,RB7可能接的是红色。
- uchar wei; //左移一位记录
- uchar word; //显示字记录
- uchar hang; //行扫描
- uchar sec50; //左移时间
- const uchar speed=100; //速度值.
- bit l;
- #define gen RA0 //行扫描使能端,低电平有效,试验证明,此脚一直为低电平不用控制也可。
- uchar const hanzi[][32]={
- {//电[16*16]横排0
- 0x01,0x00,0x01,0x00,
- 0x01,0x00,0x3F,0xF8,
- 0x21,0x08,0x21,0x08,
- 0x3F,0xF8,0x21,0x08,
- 0x21,0x08,0x21,0x08,
- 0x3F,0xF8,0x21,0x08,
- 0x01,0x02,0x01,0x02,
- 0x00,0xFE,0x00,0x00},
- {//气[16*16]横排1
- 0x08,0x00,0x08,0x00,
- 0x1F,0xFE,0x10,0x00,
- 0x20,0x00,0x4F,0xF8,
- 0x00,0x00,0x1F,0xF0,
- 0x00,0x10,0x00,0x10,
- 0x00,0x10,0x00,0x10,
- 0x00,0x0A,0x00,0x0A,
- 0x00,0x06,0x00,0x02},
- {//自[16*16]横排2
- 0x01,0x00,0x01,0x80,
- 0x02,0x00,0x1F,0xF8,
- 0x10,0x08,0x10,0x08,
- 0x1F,0xF8,0x10,0x08,
- 0x10,0x08,0x10,0x08,
- 0x1F,0xF8,0x10,0x08,
- 0x10,0x08,0x10,0x08,
- 0x1F,0xF8,0x10,0x08},
- {//动[16*16]横排3
- 0x00,0x20,0x00,0x20,
- 0x7E,0x20,0x00,0x20,
- 0x00,0xFC,0xFF,0x24,
- 0x10,0x24,0x10,0x24,
- 0x24,0x24,0x22,0x24,
- 0x4F,0x44,0xFA,0x44,
- 0x40,0x84,0x01,0x14,
- 0x02,0x08,0x00,0x00},
- {//化[16*16]横排4
- 0x08,0x80,0x0C,0x80,
- 0x08,0x88,0x10,0x8C,
- 0x10,0x98,0x30,0xB0,
- 0x50,0xE0,0x90,0xC0,
- 0x11,0x80,0x12,0x80,
- 0x14,0x80,0x10,0x84,
- 0x10,0x84,0x10,0x84,
- 0x10,0x7C,0x00,0x00},
- {//方[16*16]横排5
- 0x02,0x00,0x01,0x00,
- 0x00,0x80,0xFF,0xFE,
- 0x02,0x00,0x02,0x00,
- 0x03,0xF0,0x02,0x10,
- 0x04,0x10,0x04,0x10,
- 0x08,0x10,0x08,0x10,
- 0x10,0x10,0x20,0x90,
- 0xC0,0x60,0x00,0x00},
- {//案[16*16]横排6
- 0x02,0x00,0x01,0x00,
- 0x3F,0xFC,0x22,0x08,
- 0x04,0x40,0x7F,0xFC,
- 0x0C,0x80,0x03,0x80,
- 0x1E,0x60,0x01,0x20,
- 0x7F,0xFE,0x03,0x40,
- 0x0D,0x30,0x71,0x0E,
- 0x01,0x04,0x01,0x00},
- {//及[16*16]横排7
- 0x00,0x00,0x3F,0xE0,
- 0x04,0x20,0x04,0x20,
- 0x04,0x40,0x04,0x40,
- 0x04,0xF8,0x0A,0x50,
- 0x0A,0x10,0x09,0x20,
- 0x11,0x20,0x10,0xC0,
- 0x21,0x20,0x42,0x18,
- 0x8C,0x0E,0x30,0x04},
- {//电[16*16]横排8
- 0x01,0x00,0x01,0x00,
- 0x01,0x00,0x3F,0xF8,
- 0x21,0x08,0x21,0x08,
- 0x3F,0xF8,0x21,0x08,
- 0x21,0x08,0x21,0x08,
- 0x3F,0xF8,0x21,0x08,
- 0x01,0x02,0x01,0x02,
- 0x00,0xFE,0x00,0x00},
- {//子[16*16]横排9
- 0x00,0x00,0x3F,0xF0,
- 0x00,0x20,0x00,0x40,
- 0x00,0x80,0x01,0x00,
- 0x01,0x00,0x01,0x04,
- 0xFF,0xFE,0x01,0x00,
- 0x01,0x00,0x01,0x00,
- 0x01,0x00,0x01,0x00,
- 0x05,0x00,0x02,0x00},
- {//线[16*16]横排10
- 0x10,0x40,0x18,0x50,
- 0x10,0x4C,0x20,0x48,
- 0x23,0xFC,0x48,0x40,
- 0xF8,0x40,0x13,0xFE,
- 0x20,0x40,0x7C,0x48,
- 0x00,0x30,0x00,0x22,
- 0x1C,0xD2,0xE3,0x0A,
- 0x00,0x06,0x00,0x02},