// Copyright 2012 Matthew Hiles #include #define pause for (i=0; i < 100; i++) wait(10000) void wait(int ticks) { TAR=0; while(TAR < ticks) _NOP(); } void main(void) { int i = 0; WDTCTL = WDTPW + WDTHOLD; // stop watchdog TACTL = TASSEL_2 | MC_2; // setup TXD and RXD P1SEL = 0; // all ports GPIO P1DIR = 0xFF; // all is output while(1) { // display a 0 P1OUT = (BIT0 + BIT1 + BIT2 + BIT3 + BIT5 + BIT6); pause; // display 1 P1OUT = (BIT0 + BIT1); pause; // display 2 P1OUT = (BIT0 + BIT2 + BIT4 + BIT5 + BIT6); pause; // display 3 P1OUT = (BIT0 + BIT1 + BIT2 + BIT4 + BIT5); pause; // display 4 P1OUT = (BIT0 + BIT1 + BIT3 + BIT4); pause; //display 5 P1OUT = (BIT1 + BIT2 + BIT3 + BIT4 + BIT5); pause; //display 6 P1OUT = (BIT1 + BIT2 + BIT3 + BIT4 + BIT5 + BIT6); pause; //display 7 P1OUT = (BIT0 + BIT1 + BIT2); pause; //display 8 P1OUT = 0xFF; pause; //display 9 P1OUT = 0xFF - BIT6; pause; } }