|
还是不明白!!!
你说的那样我试过啊,不行的!!
程序如下:
它只能显示前面的七位,第八位的特殊符号1+就不能显示!!!
#include <msp430x42x0.h>
// LCD segment definitions.
#define a 0x80
#define b 0x40
#define g 0x20
#define d 0x10
#define c 0x08
#define f 0x04
#define e 0x02
#define h 0x01
const char char_gen[] = { // definitions for digits
a+b+c+d+e+f, // Displays "0"
b+c, // Displays "1"
a+b+d+e+g, // Displays "2"
a+b+c+d+g, // Displays "3"
b+c+f+g, // Displays "4"
a+c+d+f+g, // Displays "5"
a+c+d+e+f+g, // Displays "6"
a+b+c, // Displays "7"
a+b+c+d+e+f+g, // Displays "8"
a+b+c+d+f+g // Displays "9"
};
void main(void)
{
int i,j;
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
FLL_CTL0 |= XCAP14PF; // Set load cap for 32k xtal
LCDACTL = LCDON + LCD4MUX + LCDFREQ_128; // 4mux LCD, ACLK/128
LCDAPCTL0 = 0x0F; // Segments 0-13
LCD××CTL0 = LCDCPEN; // ena××e charge pump
LCD××CTL1 = 0x10; // to 2.89V
P5SEL = 0x1C; // Set COM pins for LCD
for( i = 0; i < 20; i ++)
{
LCDMEM[i] = 0; // Clear LCD
}
j=6;
for (i=0; i<20; i++) // Display "0123456"
{
//LCDMEM[i] =char_gen[i+j];
//j=j-2;
LCDMEM[i] = 0xff;
}
_BIS_SR(LPM3_bits); // Enter LPM3
} |
|