#include #include "char.c" // 74HC Pins #define DATA BIT0 //DS 1.0 #define CLOCK BIT4 // SH_CP 1.4 #define LATCH BIT5 // ST_CP 1.5 //4017 Pins #define CLOCKCP BIT6 // Clock 1.2 #define RESET BIT3 // Reset 1.3 //Declaration des prototypes de fonctions void pushRegister(int val); void pinWrite(int bit, int val); void clearAll(void); //Declaration des vaiables unsigned int DisplayBuffer[]={0,0,0,0,0,0,0,0}; unsigned int speed; short i, l, k, ShiftAmount, scroll, temp, shift_step=1; char message[]="Powered by MSP430"; char index; void clearAll(void) { int i; P1OUT |= RESET; P1OUT &= ~RESET; P1OUT &= ~LATCH; for(i=0; i<8; i++) { pinWrite(DATA, 0); P1OUT |= CLOCK; P1OUT &= ~CLOCK; } P1OUT |= LATCH; } void main(void) { WDTCTL = WDTPW + WDTHOLD; //stop watchdog P1DIR |= (DATA + CLOCK + LATCH + CLOCKCP + RESET); //mise en sortie clearAll(); while(1) { for(k=0; k> ((8-shift_step)-scroll*shift_step)); } speed = 15; for(l=0; l0; i--) { pinWrite(DATA, (val & (1 << i))); P1OUT |= CLOCK; //clock 74HC P1OUT &= ~CLOCK; } P1OUT |= LATCH; P1OUT &= ~LATCH; for(i=0; i<8; i++) { pinWrite(DATA, 0); P1OUT |= CLOCK; //clock 74hc P1OUT &= ~CLOCK; } P1OUT |= LATCH; P1OUT |= CLOCKCP; //clock 4017 P1OUT &= ~CLOCKCP; } void pinWrite(int bit, int val) { if(val) P1OUT |= bit; else P1OUT &= ~bit; }