Hello everyone!
I'm starting learning PIC microcontrollers and have already done the first project, to blink a LED.
But, as a second one, I decided to try a digital input. So, the idea is, when the push button (connected in RA1) is not pressed, the first LED connected to RB3 receives 1, so it's on, and the second LED, connect to RB2 receives 0, so it's off. When the button is pressed, everything changes, so the first LED turns off, while the other one turns on.
The problem is: When I press the button, nothing happens. I've already saw the voltage on RA1 and the pushbutton is working as I want it to do, but the LEDs doesn't change.
I'm attaching at this trend the code that I'm using and the circuit at the breadboard.
Thank you guys so much for the attention!
I'm starting learning PIC microcontrollers and have already done the first project, to blink a LED.
But, as a second one, I decided to try a digital input. So, the idea is, when the push button (connected in RA1) is not pressed, the first LED connected to RB3 receives 1, so it's on, and the second LED, connect to RB2 receives 0, so it's off. When the button is pressed, everything changes, so the first LED turns off, while the other one turns on.
The problem is: When I press the button, nothing happens. I've already saw the voltage on RA1 and the pushbutton is working as I want it to do, but the LEDs doesn't change.
I'm attaching at this trend the code that I'm using and the circuit at the breadboard.
Thank you guys so much for the attention!
Attachments
-
33.2 KB Views: 25
-
138.5 KB Views: 23