#include void push_16bit_to_display (int); //Subprogram to push 16 bit to 74hc595 const int Txt_on_screen_with_position[8]={0xE380,0xF340,0x7120,0x6110,0x4308,0xC504,0xC502,0x8501}; int counter_for_screen_position; // Additional counter int main(void) {WDTCTL = WDTPW + WDTHOLD; // Stop WDT P1DIR |= BIT1+BIT2+BIT3; // P1.1, P1.2, P1.3 as outputs, rest as is while(1){ // Loop to infinity push_16bit_to_display (Txt_on_screen_with_position [counter_for_screen_position++]); if(counter_for_screen_position == 8) counter_for_screen_position=0;} // 8 times limit } void push_16bit_to_display (int Data) // Subprogram for serial upload {int bit_number; // Temp. variable, bit_number for (bit_number = 0; bit_number < 16; bit_number++) // Loop 16 bits to write to 74hc595 {P1OUT = 0x00; // Reset all output ('low' on ALL) if((Data >> bit_number) & 0x01) P1OUT |= 0x04; // If==1 then set 'DATA' line (P1.2), 'hi' P1OUT |= BIT3; P1OUT &= ~BIT3;} // Cycle 'CLOCK' line (P1.3) 'hi'-'low' P1OUT |= BIT1; P1OUT &= ~BIT1;} // Cycle 'WRITE' line (P1.1) 'hi'-'low'