- UID
- 872235
|
#include<msp430x14x.h>
unsigned char table[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
void delay()
{
unsigned int i;
for(i=0;i<50000;i++);
}
void main()
{
unsigned char i,j;
WDTCTL = WDTPW + WDTHOLD; //关闭看门狗
BCSCTL2 &=0xc0; //XT2CLK+2分频
P4DIR = 0xff; //输出
P6DIR = 0xff; //输出
P6SEL = 0x00; //关闭第二功能
P4SEL = 0x00; //关闭第二功能
P3DIR = 0xff; //输出
for(;;)
{
P4OUT=0x00;
P6OUT=0x00;
P4OUT=0xff;
P6OUT=0xff;
for(i=0;i<10;i++)
{
P4OUT=table;
P6OUT=0x00;
P3OUT=0x00;
delay();
}
}
} |
|