MSP430G2553初学:为什么P1.0 P1.6的LED点不亮啊
我把这个程序烧进去为什么P1.0P1.6的LED不亮啊#include"msp430g2553.h"intmain(void){WDTCTL=WDTPW+WDTHOLD;...
我把这个程序烧进去 为什么P1.0 P1.6的LED不亮啊
#include "msp430g2553.h"
int main( void )
{
WDTCTL = WDTPW + WDTHOLD;
P1DIR |= 0x01;
while(1)
{
volatile unsigned int i;
P1OUT ^= 0x01;
i = 50000;
while (i--);
}
} 展开
#include "msp430g2553.h"
int main( void )
{
WDTCTL = WDTPW + WDTHOLD;
P1DIR |= 0x01;
while(1)
{
volatile unsigned int i;
P1OUT ^= 0x01;
i = 50000;
while (i--);
}
} 展开
2个回答
展开全部
#include<msp430g2553.h>
#define uint unsigned int
void main(void){
uint i,j;
WDTCTL=WDTPW+WDTHOLD;
P1DIR|=BIT0;
P1DIR|=BIT6;
while(1)
{
for(i=0;i<50000;i++)
{
P1OUT=0X01;
//P1OUT|=BIT0;
//P1OUT&=~BIT6;
}
for(j=0;j<50000;j++)
{
P1OUT=0X40;
//P1OUT|=BIT6;
//P1OUT&=~BIT0;
}
}
}
#define uint unsigned int
void main(void){
uint i,j;
WDTCTL=WDTPW+WDTHOLD;
P1DIR|=BIT0;
P1DIR|=BIT6;
while(1)
{
for(i=0;i<50000;i++)
{
P1OUT=0X01;
//P1OUT|=BIT0;
//P1OUT&=~BIT6;
}
for(j=0;j<50000;j++)
{
P1OUT=0X40;
//P1OUT|=BIT6;
//P1OUT&=~BIT0;
}
}
}
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询