#include<msp430x24x.h>
#define charsize 8
#define datasize 8
#define uchar unsigned char
uchar disbuff[8]={0,1,2,3,4,5,6,7};
uchar seg[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};
void dis();
void main()
{
while(1)
{
uchar i,j;
uchar temp;
P1DIR=0X07;
P1OUT|=0X05;
for(i=0;i<datasize;i++)
{
temp=0x80;
for(j=0;j<charsize;j++)
{
if((seg[disbuff[i]]&temp)!=0)
{
P1OUT|=0X02;
P1OUT&=0XFE;
P1OUT|=0X01;
}
else
{P1OUT&=0XFD;
P1OUT&=0XFE;
P1OUT|=0X01;
for(unsigned int i=0;i<5000;i++); }
temp/=2;
}
}
P1OUT&=0XFB;
}
} |