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.

CCS: Brightness Using ADC in MSP430FR4133

Other Parts Discussed in Thread: MSP430FR4133

Tool/software: Code Composer Studio

Hi, 

   I am using MSP430FR4133 , I have Tried controlling the LED using A potentiometer (ADC). But i am only able to Switch ON and OFF the LED by Reading the value stored in the ADCMEM0. Is it possible to control the voltage Input for a particular port pin by reading ADCMEM0. for example : controlling the brightness of the LED.

here is the part of a code i used ..

Source :

if (ADC_getResults(ADC_BASE) < 0x155) {
//Turn LED1 off
GPIO_setOutputLowOnPin(
GPIO_PORT_LED1,
GPIO_PIN_LED1
);

//Turn LED2 off
GPIO_setOutputLowOnPin(
GPIO_PORT_LED2,
GPIO_PIN_LED2
);
}
else {
//Turn LED1 on
GPIO_setOutputHighOnPin(
GPIO_PORT_LED1,
GPIO_PIN_LED1
);

//Turn LED2 on
GPIO_setOutputHighOnPin(
GPIO_PORT_LED2,
GPIO_PIN_LED2
);
}

**Attention** This is a public forum