找LCD规格资料,硬件上SEG和COM对好,写个测试程序,单个笔画显示, 这样说明已经没有问题
.c文件
/*==============================================================================
===A===
// //
F// //B
// //
===G===
// //
E// //C
// //
===D===
==============================================================================*/
u8 code LCD_ShowTable[]={
/*0*/SEG_A | SEG_B | SEG_C | SEG_D | SEG_E | SEG_F,
/*1*/SEG_B | SEG_C,
/*2*/SEG_A | SEG_B | SEG_D | SEG_E | SEG_G,
/*3*/SEG_A | SEG_B | SEG_C | SEG_D | SEG_G,
/*4*/SEG_B | SEG_C | SEG_F | SEG_G,
/*5*/SEG_A | SEG_C | SEG_D | SEG_F | SEG_G,
/*6*/SEG_A | SEG_C | SEG_D | SEG_E | SEG_F | SEG_G,
/*7*/SEG_A | SEG_B | SEG_C,
/*8*/SEG_A | SEG_B | SEG_C | SEG_D | SEG_E | SEG_F | SEG_G,
/*9*/SEG_A | SEG_B | SEG_C | SEG_D | SEG_F | SEG_G,
/*a*/SEG_A | SEG_B | SEG_C | SEG_E | SEG_F | SEG_G,
/*b*/SEG_C | SEG_D | SEG_E | SEG_F | SEG_G,
/*c*/SEG_A | SEG_D | SEG_E | SEG_F,
/*d*/SEG_B | SEG_C | SEG_D | SEG_E | SEG_G,
/*e*/SEG_A | SEG_B | SEG_D | SEG_E | SEG_F | SEG_G,
/*f*/SEG_A | SEG_B | SEG_E | SEG_F | SEG_G,
/*h*/SEG_C | SEG_E | SEG_F | SEG_G,
/*E*/SEG_A | SEG_D | SEG_E | SEG_F | SEG_G,
/*H*/SEG_B | SEG_C | SEG_E | SEG_F | SEG_G,
/*L*/SEG_D | SEG_E | SEG_F,
/*-*/SEG_G,
/*null*/C_BitNull,
/*t*/SEG_A | SEG_B | SEG_F,
/*b*/SEG_C | SEG_D | SEG_E,
/*o*/SEG_C | SEG_D | SEG_E | SEG_G,
/*i*/SEG_C,
/*seg_a*/SEG_A,
/*seg_b*/SEG_B,
/*seg_c*/SEG_C,
/*seg_d*/SEG_D,
/*seg_e*/SEG_E,
/*seg_f*/SEG_F,
/*seg_g*/SEG_G,
/*seg_V*/SEG_B | SEG_C | SEG_D | SEG_E | SEG_F,
};
.h文件
//==========================================================================
#define C_BitNull 0x00
#define C_Bit0 0x01
#define C_Bit1 0x02
#define C_Bit2 0x04
#define C_Bit3 0x08
#define C_Bit4 0x10
#define C_Bit5 0x20
#define C_Bit6 0x40
#define C_Bit7 0x80
#define SEG_A C_Bit0
#define SEG_B C_Bit1
#define SEG_C C_Bit2
#define SEG_D C_Bit3
#define SEG_E C_Bit4
#define SEG_F C_Bit5
#define SEG_G C_Bit6
#define SEG_DP C_Bit7
//==========================================================================
#define C_LCD_SHOW_0 0
#define C_LCD_SHOW_1 1
#define C_LCD_SHOW_2 2
#define C_LCD_SHOW_3 3
#define C_LCD_SHOW_4 4
#define C_LCD_SHOW_5 5
#define C_LCD_SHOW_6 6
#define C_LCD_SHOW_7 7
#define C_LCD_SHOW_8 8
#define C_LCD_SHOW_9 9
#define C_LCD_SHOW_a 10
#define C_LCD_SHOW_b 11
#define C_LCD_SHOW_c 12
#define C_LCD_SHOW_d 13
#define C_LCD_SHOW_e 14
#define C_LCD_SHOW_f 15
#define C_LCD_SHOW_h 16
#define C_LCD_Show_E 17
#define C_LCD_Show_H 18
#define C_LCD_Show_L 19
#define C_LCD_Show_NoValue 20//"-"
#define C_LCD_Show_Null 21//" "
#define C_LCD_Show_T 22//abf
#define C_LCD_Show_B 23//cde
#define C_LCD_Show_o 24
#define C_LCD_Show_i 25
#define C_LCD_Show_SEG_A 26
#define C_LCD_Show_SEG_B 27
#define C_LCD_Show_SEG_C 28
#define C_LCD_Show_SEG_D 29
#define C_LCD_Show_SEG_E 30
#define C_LCD_Show_SEG_F 31
#define C_LCD_Show_SEG_G 32
#define C_LCD_Show_V 33
extern u8 code LCD_ShowTable[];
只能帮到这里了 |