Author Topic: Reading inputs  (Read 1839 times)

Rush

  • Newbie
  • *
  • Posts: 2
    • View Profile
Reading inputs
« on: May 06, 2012, 03:09:25 AM »
can someone explain what I'm doing wrong here?

I watch this in my scope and i can read status 1 on RA3 but when i pass the value of RA3 in the program it's always 0

unsigned char i;

   LATA3 = 0;
   Delay10TCYx(1);
        LATA3 = 1;
   LATA2 = 1; // Set Trigger for oscilloscope
   TRISA_RA3 = 1;
   Delay10TCYx(15);
        i = PORTA_RA3;
   LATA2 = 0; // Reset trigger for oscilloscope
   return(i);

Regards
Rush