#include "msp430g2231.h" #define LED1 BIT0 #define LED2 BIT6 #define DEL1 5000 #define DEL2 20000 void delaytime(unsigned int timex) { while (timex != 0) { timex--; } } void main(void) { WDTCTL = WDTPW + WDTHOLD; P1DIR |= (LED1 + LED2); P1OUT &= ~(LED1 + LED2); for (;;) { unsigned int y; for (y=0; y < 5; y++) { P1OUT ^= LED1; delaytime(DEL1); } P1OUT &= ~(LED1); delaytime(DEL2); for (y=0; y < 5; y++) { P1OUT ^= LED2; delaytime(DEL1); } P1OUT &= ~(LED2); delaytime(DEL2); } }