This is a simple application of internal 10-bit ADC(analog to digital converter) of MSP430G2231 microcontroller.you can use this ...