Hey I'm new in here.
I have a problem.
I want to write a program. I designed a hardware and software for monitoring button connected to use PORTB. If there is press on buton then turn LED on. If you no press on the button the turn LED off.
So, I write code and I designed circuit to proteus.
Problem is LED always lights up.
When I do not press on button, LED is on, When I do press on button still LED is on. LED is always lights up.
I attach here two picture. Codes and circuits.
What is problem? is there anyone who can help
I use PIC18F45K22
I have a problem.
I want to write a program. I designed a hardware and software for monitoring button connected to use PORTB. If there is press on buton then turn LED on. If you no press on the button the turn LED off.
So, I write code and I designed circuit to proteus.
Problem is LED always lights up.
When I do not press on button, LED is on, When I do press on button still LED is on. LED is always lights up.
I attach here two picture. Codes and circuits.
What is problem? is there anyone who can help
I use PIC18F45K22
Attachments
-
362 KB Views: 14
-
277.9 KB Views: 15