/****************************************************************************** Function: void APP_ADC_AverageOnLEDs ( void ) Description: Display the magnitude of the ADC value on LEDs. */ void APP_ADC_AverageOnLEDs ( void ) { /* Convert 12-bit ADC value to 2-bits */ appData.potValue >>= 10; /* Display the magnitude of the ADC value on LEDs. Use the Board Support Package (BSP) library to turn LEDs on and off. */ switch ( appData.potValue ) { case 0b00: { BSP_LEDOn(BSP_LED_1); BSP_LEDOff(BSP_LED_2); BSP_LEDOff(BSP_LED_3); BSP_LEDOff(BSP_LED_4); break; } case 0b01: { BSP_LEDOn(BSP_LED_1); BSP_LEDOn(BSP_LED_2); BSP_LEDOff(BSP_LED_3); BSP_LEDOff(BSP_LED_4); break; } case 0b10: { BSP_LEDOn(BSP_LED_1); BSP_LEDOn(BSP_LED_2); BSP_LEDOn(BSP_LED_3); BSP_LEDOff(BSP_LED_4); break; } case 0b11: { BSP_LEDOn(BSP_LED_1); BSP_LEDOn(BSP_LED_2); BSP_LEDOn(BSP_LED_3); BSP_LEDOn(BSP_LED_4); break; } default: { break; } } }