各位大哥,我想在P3.0,P3.1,P3.2输出高电位,这样写程序行不行?请指教
#include <msp430x44x.h>
void main( void )
{
WDTCTL = WDTPW +WDTHOLD;
p3DIR = 0X07;
p3OUT = 0X07;
for(;;)
{_BIS_SR(LPM0_bits);
_NOP();
}
}
编译可以就可以吧.
#include "msp430x44x.h"
void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
while(1)
{
P3DIR |= BIT0 + BIT1 + BIT2; // to output direction
P3OUT |= BIT0 + BIT1 + BIT2; // to output
{
}