Im using pic18f4550.Im checking input state of B4 & b5 in main programme. (Im using ccs)
If input are high another sub programme should run.But programme can not check the input.Whats the wrong?please help.
if (input(pin_b4)) {
[COLOR="blue"]//runs only if pin_4 is equal to 1[/COLOR]
while (input(pin_b4)) {
} [COLOR="red"]//but this loop is waiting until pin_4 == 0[/COLOR]
...
... [COLOR="blue"]//so your instructions here are not executed until pin_4 goes to 0[/COLOR]
...
}
My recommendation:
at first write a simple program to sense the input pin state only,
and only then continue if it is already working well.