> What do you mean ? none of the inputs are floating .... Can you please answer some specific questions so we can get to the bottom of this Firstly, did you read this ? http://www.piclist.com/techref/microchip/portpins.htm Have you specified /mclr as active, and as an input ? If so, is it connected to Vcc, either directly or through a resistor ? All other pins should be set as outputs, with the exception of the two pins you are using for reading the switches Those pins should have pull-down resistors. If you have them, what is their value ? All pins must be set as digital (with ANSEL, or whatever register controls that) Are the LEDs connected between the pin and Vcc or the pin and Vss ? Do you have series resistors with the LEDs. What is their value ? To the software - If you are wanting the LED to come on if its corresponding switch is closed, therefore if initially both switches are off, so should both LEDs Upon detection of a switch input reading as '1', do you have a debounce delay ? Contact noise during closure will give you a false open, similarly contact noise during opening will give you a false closure. Contact noise is seen by the micro as a random series of 1s and 0s (ie a rapid series of open/closed states). You have to let the contacts come to rest before the action can be considered completed. Otherwise the software will rapidly loop, turning the LED on and off, tracking the noise Wait for switch closure (ie detect a '1') Turn LED on Delay for 100ms, waiting for contact bounce to stop, settle to '1' Wait for switch opening (ie detect a '0') Turn LED off Delay for 100ms, waiting for contact bounce to stop, settle to '0' Loop back to detecting a closure 100ms is only a suggestion. In practice noise may be there for a shorter time, perhaps 20ms, and there are other, more involved ways of dealing with ounce, but you would be best to stick with a simple longish delay for now Joe -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist