EasyManua.ls Logo

Texas Instruments MSP430 - Page 121

Texas Instruments MSP430
413 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
121
/* initialize Config for the MSP430 WDT+ */
WDTplus_graceInit();
LCD_init();
LCD_clear_home();
LCD_goto(0, 0);
LCD_putstr("Capt./us:");
delay_ms(10);
while(1)
{
if((P1IN & BIT3) == 0)
{
P1OUT |= BIT0;
while((P1IN & BIT3) == 0);
i++;
if(i > 9)
{
i = 0;
}
P1OUT &= ~BIT0;
}
switch(i)
{
case 1:
{
TA0CCR0 = 9999;
LCD_goto(0, 1);
LCD_putstr("Period/ms: 20");
break;
}
case 2:
{
TA0CCR0 = 4999;
LCD_goto(0, 1);
LCD_putstr("Period/ms: 10");
break;
}
case 3:
{
TA0CCR0 = 1999;
LCD_goto(0, 1);
LCD_putstr("Period/ms: 4");
break;
}
case 4:
{
TA0CCR0 = 999;
LCD_goto(0, 1);
LCD_putstr("Period/ms: 2");
break;
}
case 5:
{
TA0CCR0 = 166;
LCD_goto(0, 1);

Table of Contents

Other manuals for Texas Instruments MSP430

Related product manuals