Advertisement
Guest User

Untitled

a guest
May 10th, 2019
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* ========================================
  2.  *
  3.  * Copyright YOUR COMPANY, THE YEAR
  4.  * All Rights Reserved
  5.  * UNPUBLISHED, LICENSED SOFTWARE.
  6.  *
  7.  * CONFIDENTIAL AND PROPRIETARY INFORMATION
  8.  * WHICH IS THE PROPERTY OF your company.
  9.  *
  10.  * ========================================
  11. */
  12. #include "project.h"
  13. #include "stdio.h"
  14.  
  15. int main(void)
  16. {
  17.    ADC_Start();
  18.    UART_Start();
  19.  
  20.  
  21.  
  22. int x;
  23. int y;
  24.  
  25.  
  26.    
  27.  
  28.  
  29.     CyGlobalIntEnable; /* Enable global interrupts. */
  30.  
  31.     /* Place your initialization/startup code here (e.g. MyInst_Start()) */
  32.  
  33.     for(;;)
  34.     {
  35.          
  36.      
  37.           ADC_StartConvert();
  38.  
  39.        ADC_IsEndConversion(ADC_WAIT_FOR_RESULT);
  40.        
  41.             x=ADC_GetResult16(0);
  42.         int y=ADC_CountsTo_mVolts(0,x);
  43.      
  44.          
  45.      UART_PutString("y");
  46.        
  47.        
  48.  
  49.        
  50.      
  51.        
  52.         CyDelay(100);
  53.         /* Place your application code here. */
  54.     }
  55. }
  56.  
  57. /* [] END OF FILE */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement