#include<msp430x14x.h>
#define uchar unsigned char
#define uint unsigned int
unsigned char ta××e[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
uint result;
uint i;
uchar nn;
void delay()
{
uint time;
uint time1;
for(time=0x0fff;time>0;time--)
{
for(time1=0x00ff;time1>0;time1--)
{
;
}
}
}
void show(uint number )
{
uint data;
uint data1;
uchar num1;
uchar num2;
uint data2;
uchar num3;
uint buffer;
data=number*3/4096;
buffer=number*3%4096;
data1=buffer*10/4096;
buffer=buffer*10%4096;
data2=buffer*10/4096;
num3=(uchar)data2;
num1=(uchar)data;
num2=(uchar)data1;
switch(num1)
{
case 0x00:num1=ta××e[0]+0x80;break;
case 0x01:num1=ta××e[1]+0x80;break;
case 0x02:num1=ta××e[2]+0x80;break;
case 0x03:num1=ta××e[3]+0x80;break;
case 0x04:num1=ta××e[4]+0x80;break;
case 0x05:num1=ta××e[5]+0x80;break;
case 0x06:num1=ta××e[6]+0x80;break;
case 0x07:num1=ta××e[7]+0x80;break;
case 0x08:num1=ta××e[8]+0x80;break;
case 0x09:num1=ta××e[9]+0x80;break;
}
switch(num2)
{
case 0x00:num2=ta××e[0];break;
case 0x01:num2=ta××e[1];break;
case 0x02:num2=ta××e[2];break;
case 0x03:num2=ta××e[3];break;
case 0x04:num2=ta××e[4];break;
case 0x05:num2=ta××e[5];break;
case 0x06:num2=ta××e[6];break;
case 0x07:num2=ta××e[7];break;
case 0x08:num2=ta××e[8];break;
case 0x09:num2=ta××e[9];break;
}
switch(num3)
{
case 0x00:num3=ta××e[0];break;
case 0x01:num3=ta××e[1];break;
case 0x02:num3=ta××e[2];break;
case 0x03:num3=ta××e[3];break;
case 0x04:num3=ta××e[4];break;
case 0x05:num3=ta××e[5];break;
case 0x06:num3=ta××e[6];break;
case 0x07:num3=ta××e[7];break;
case 0x08:num3=ta××e[8];break;
case 0x09:num3=ta××e[9];break;
}
switch(nn)
{
case 0x00:P4OUT=~num1;P6OUT = BIT5; break;
case 0x01:P4OUT=~num2;P6OUT = BIT4; break;
case 0x02:P4OUT=~num3;P6OUT = BIT3; break;
case 0x03:P4OUT=0xc1;P6OUT = BIT2; break;
}
nn++;
if(nn>3)
{
nn=0;
}