EasyManua.ls Logo

Texas Instruments MSP430

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...
402
NMI_VECTOR,COMPARATORA_VECTOR, \
ADC10_VECTOR
__interrupt void ISR_trap(void)
{
// the following will cause an access violation which results in a PUC reset
WDTCTL = 0;
}
// Main Function
void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
GPIO_graceInit();
BCSplus_graceInit();
TI_CAPT_Init_Baseline(&multi_buttons);
TI_CAPT_Update_Baseline(&multi_buttons, 25);
// Main loop starts here
while (1)
{
keyPressed = (struct Element *)TI_CAPT_Buttons(&multi_buttons);
if(keyPressed)
{
// Up Element
if(keyPressed == &up_element)
{
P1OUT |= BIT0;
}
// Down Element
if(keyPressed == &down_element)
{
P1OUT |= BIT6;
}
// Middle Element
if(keyPressed == &middle_element)
{
P1OUT = 0;
}
}
sleep(DELAY);
}
} // End Main
void GPIO_graceInit(void)
{
/* USER CODE START (section: GPIO_graceInit_prologue) */
/* User initialization code */
/* USER CODE END (section: GPIO_graceInit_prologue) */
/* Port 1 Output Register */
P1OUT = 0;

Table of Contents

Other manuals for Texas Instruments MSP430

Related product manuals