Dear All, I've tried to read the pin of Port1 , but i failed . I should write one to it right ? , how do i read a one again ? If i tried to write the following code,it works without checking the status of the pin Port1_3=1; if(Port1_3==1) { // execute code here .. // code here executes in the simulator //without checking if the pin is //high or not } thanks in advance
thanks erik. I tried to use this code and it works in the simulator, could you tell me what's ur opinion about it ? : void main (void) { pin_4=1; while(1) { while (pin_4 !=1) { P2=0xFF; DELAY_LOOP_Wait(90); if ( pin_4==1) { p++; if ( p==5) { P2=0x00; } } } }