Select a demo from the dropdown menu to the left, then click on the hand to start.
Click on the hand to press or release the button
Button
200Ω
10kΩ
5V
200Ω
LED
MICROCHIP
RA0
RC0
RC1
Timing Diagram
RAO
(Button
pin)
5V
0V
RC0
(LED
pin 1)
5V
0V
RC1
(LED
pin 2)
5V
0V
(Now)
Explanation of the BUTTON PRESS code:

When the button is pressed down, it connects a high voltage to pin RA0. When the button is released, then pin RA0 is connected to a low voltage.

In this case, the microchip has been programmed such that when it detects a high voltage on the button pin, RA0, it sets the voltage of the LED's first pin, RC0, to a high voltage also.

Likewise, when it detects a low voltage on the button pin, RA0, it sets the LED's first pin, RC0, to low voltage also.

The LED's second pin, RC1, is kept at low voltage to complete the circuit, and so the LED lights up when the button is pressed and turns off when the button is released. Go ahead and test this now.