title: Reading input pin of pic microcontroller with MIKROC
body: <p>I need to write a program that will check if an input pin of PIC has a voltage. If a voltage exists then it will give voltage to a selected output pin like <code>PORTB.RB1=1;</code>. Else it will give voltage to other selected output pin like <code>PORTC.RC1=1;</code>.</p>
  
  <p>Is it possible? I have tried to do this, but it does not work .</p>
  
  <pre><code>void main() {
  
      TRISB=0;
      TRISA=1;
      TRISC=0;
  
      while(1){
          delay_ms(500);
          // PORTB=0;
          if(PORTA==1){
              PORTB.RB1 =1;
          }
          else{
              PORTC.RC1 =1;
          }
      }
  }
  </code></pre>