|
Attached the top design schematic image. See if this works for you.
#include <device.h>
uint16 output;
uint16 output1;
CY_ISR(My_Isr_Routine)
{
ADC_DelSig_1_IsEndConversion(ADC_DelSig_1_WAIT_FOR_RESULT);
output = ADC_DelSig_1_GetResult16();
output1 = ADC_DelSig_1_GetResult16();
}
void main()
{
/* Start the components */
CYGlobalIntEnable;
isr_StartEx(My_Isr_Routine);
isr_Enable();
LCD_Start();
ADC_DelSig_1_Start();
/* Start the ADC conversion */
ADC_DelSig_1_StartConvert();
/* Display the value of ADC output on LCD */
LCD_Position(0, 0);
LCD_PrintString("ADC_Output");
while(1)
{
ADC_DelSig_1_SelectConfiguration(1,1);
LCD_Position(1, 0);
LCD_PrintInt16(output);
CyDelay(2000);
ADC_DelSig_1_Stop();
ADC_DelSig_1_StopConvert();
//ADC_DelSig_1_SelectConfiguration(1,0);
LCD_ClearDisplay();
ADC_DelSig_1_SelectConfiguration(2,1);
ADC_DelSig_1_Start();
ADC_DelSig_1_StartConvert();
LCD_Position(1, 10);
LCD_PrintInt16(output1);
CyDelay(2000);
LCD_ClearDisplay();
}
}
|