1 Reply Latest reply on Apr 14, 2018 3:34 AM by bob.marlowe

    How do I get the result of the ADC printed on Putty?  I am using PSoC 5LP developmental board with PSoC Creator 3.3.

    zhoumiaochen

      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);

              }

          }

      }