main.c 509 B

1234567891011121314151617181920212223242526
  1. #include <msp430.h>
  2. // Short delay method, until I figure out timers.
  3. void delay (unsigned long int d) {
  4. unsigned long int i;
  5. for (i = 0; i < d; ++i) { asm("nop"); }
  6. }
  7. int main() {
  8. // Stop the watchdog timer.
  9. WDTCTL = (WDTPW + WDTHOLD);
  10. // Set P1.0 and P1.6 to output mode.
  11. P1DIR |= (BIT0 | BIT6);
  12. // Set initial LED states.
  13. P1OUT |= (BIT0);
  14. P1OUT &= ~(BIT6);
  15. while (1) {
  16. // Toggle the LEDs, and delay a bit.
  17. P1OUT ^= (BIT0 | BIT6);
  18. delay(100000);
  19. }
  20. return 0;
  21. }