- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using the ADC_SingleEndedMode Example.
#define USBFS_DEVICE (0u)
#define USBUART_BUFFER_SIZE (64u)
#define LINE_STR_LENGTH (20u)
int main()
{
int16 output;
uint8 buffer[USBUART_BUFFER_SIZE];
/* Start the components */
CyGlobalIntEnable;
LCD_Start();
USBUART_Start(USBFS_DEVICE, USBUART_3V_OPERATION);
ADC_DelSig_1_Start();
/* Start the ADC conversion */
ADC_DelSig_1_StartConvert();
/* Display the value of ADC output on LCD */
LCD_Position(0u, 0u);
LCD_PrintString("ADC_Output");
for(;;)
{
if(ADC_DelSig_1_IsEndConversion(ADC_DelSig_1_RETURN_STATUS))
{
output = ADC_DelSig_1_GetResult16();
/* Saturate ADC result to positive numbers. */
if(output < 0)
{
output = 0;
}
USBUART_PutChar(output);
LCD_Position(1u, 0u);
LCD_PrintInt16(output);
}
}
}
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Instead of USBUART_PutChar(output); you will need a bit more as
#include <stdio.h>
uint8 Buffer[80];
sprintf(Buffer,"%d \n\r",output);
USBUART_PutString(Buffer);
Happy coding
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Instead of USBUART_PutChar(output); you will need a bit more as
#include <stdio.h>
uint8 Buffer[80];
sprintf(Buffer,"%d \n\r",output);
USBUART_PutString(Buffer);
Happy coding
Bob