This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP-EXP430G2: Code to display button pushes to 16x2 LCD

Part Number: MSP-EXP430G2


Tool/software: Code Composer Studio

Hello,

          Can anyone help me figure out how to have my button press counter "count" display to the LCD display. The push button is the p1.3 button on the msp430 board and I can see the updated value in the expression window, and I can output static messages to the LCD, but no idea how to display the count or to get it to continually update while the code is running and button is being pushed.I used a LCD header file that i found online that has the LCD in 4 bit mode, as I will eventually use all the pins. Do i have to add extra code to the header file, if so what?Sorry if this seems rudimentary, i'm an ee student(read:programming noob) and took this class not knowing how much programming was involved.I have attached my main file and the header file. 

Thanks in advance for any help.

#include <msp430.h> 
#include "lcd1.h"
#define BUTTON BIT3

/**
 * main.c
 */
unsigned int count = 0;
void main(void)
{
	WDTCTL = WDTPW | WDTHOLD;	// stop watchdog timer
	
	    P1IE = BUTTON; //enable interrupt
		P1IES = BUTTON; //interrupt edge
		P1REN = BUTTON; //enable resistor tied to button
		P1IFG = 0x00;   //clear the interrupt flag

		_enable_interrupts();  //enable all interrupts
		lcd_init();
		lcd_out ("count:");

		while(1);
}
	#pragma vector = PORT1_VECTOR  //define interrupt vector
	__interrupt void PORT1_ISR(void){         //interrupt service routine for port 1
	    if((P1IN & BUTTON) == 0x00)//when button is pushed
	        count++;             // count increments to keep track of pushes
	    P1IFG = 0x00;      //clear the interrupt flag
}

lcd1.h

**Attention** This is a public forum