1 2 3 Previous Next 41 Replies Latest reply on Sep 27, 2015 2:57 PM by user_14586677

    Reading a pulses

    valskibuda_1466811

      Hi 

         

      Hi I am new to PSoC. 

         

      I want to read 3 pulses in a row and then set a pin High.  

         

      This is my code it does not work. 

         

       

         

      int main()
      {
         CyGlobalIntEnable;
         UART_1_Start();
            /* Place your initialization/startup code here (e.g. MyInst_Start()) */
       
          /* CyGlobalIntEnable; */ /* Uncomment this line to enable global interrupts. */
      for(;;) {
       

         

        high = Pin_1_Read(); // reading the pin
         
          
          while(count < 3)    
          {
          count = count+high;   
              
          }
         
          if(count > 3)
          {
              Setpin_Write(1); 
              
          }
          else 
          Setpin_Write(0); 

        1 2 3 Previous Next