Well JasonStew,
Digital is simple, if you have the 5 v it is a one and if not it is a zero, so set one of the ports to input, just for hoots I will say PortB.7 like so TRISB = %10000000 and now portb.7 is an input. Now really simple Psuedocode If Portb.7 = 1 then portb.6 = 1 and viola if portb.7 is switched on then it switches the output on portb.6 to on status. You see I set the other 3 usable ports on PortB as outputs in the tris statement. I think it causes less confusion if you get in the habit of using all 8 bits in your port and register declarations even when the port has "unimplemented" bits like the 4 lower bits(ports) in portb of the 16f690. When you setup the ports and tris registers, it seems counter intuitive but set the port register first then set up the tris register. That way any outputs are set to the desired state before they become outputs (THANKS BRUCE ).
Bookmarks