Search found 1 match

by ahmadalnokta
19 Dec 2023 12:44
Forum: mikroC PRO for PIC General
Topic: Reading a push button is not working
Replies: 2
Views: 418

Reading a push button is not working

Hello, I have this simple issue. I'm using PIC16F18344 to turn on an LED when the button is pressed but it is not working. LED --> RC5 push button --> RA5 This is the code: void main() { TRISA.F5 = 1; TRISC.F5 = 0; PORTC.F5 = 0; while(1){ if(PORTA.F5 == 1) PORTC.F5 = 1; else PORTC.F5 = 0; } }

Go to advanced search