#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;
// P4OUT=~table[2];
for(i=0;i<10;i++)
{
P4OUT=table;
P6OUT=0x00;
P3OUT=0x00;
delay();
}
}
}
http://item.taobao.com/auction/item_detail.jhtml?item_id=95962d4e24ec179a5f47705225c50458&x_id=0db2
文章评论(0条评论)
登录后参与讨论