1 //#include "io430.h" 2 #include "MSP430G2553.h" 3 4 int main( void ) 5 { 6 volatile unsigned int i; 7 8 WDTCTL = WDTPW + WDTHOLD; // 关闭看门狗 9 10 11 P1DIR = 0XFF; // 设置P1全部为输出 12 P1OUT = 0; // 全部输出为0 13 /* 14 P2DIR = 0XFF; // 设置P2为输出 15 P2OUT = 0; 16 */ 17 18 while(1) 19 { 20 P1OUT |= BIT0 + BIT6; // 置1,点亮发光管 21 __delay_cycles(100000); 22 P1OUT &= ~BIT0; // 置0,关闭发光管 23 __delay_cycles(400000); 24 } 25 26 27 return 0; 28 }
MSP430之Hello World!,布布扣,bubuko.com
时间: 2024-10-18 21:24:12