You are on page 1of 2

The diagram shown above is a basic connection for a push button to PIC I/O port as input.

The resistor value can be at the range from 4.7K ohm to 10K ohm. Any type of pushbutton, on-off switch and limit switch can be connecting like this way. Please make sure that the I/O pin that use for push button is set to high 1(TRIS) as we use the pin as an input.

There are two methods of connecting LED (Output) to PIC. LED 1 is connected in active-high, which mean the LED will ON if the pin is high 1. Whereas, LED 2 is connected in active-low method. LED will only ON when the pin is low 0.

Please make sure that the I/O pin that use for LED is set to low 0(TRIS) as we use the pin as an output.

You might also like