anandhuskumar
Junior Member level 1
I'm using PIC16f676 for my project. I want to simply read a switch and turn on/off RC2 and RC3. The switch is connected to RC0 or RA2. I'm using HiTechC pro V9.8 compiler.
I tried "if(RC0==1){RC2=1; RC3=1;}" in the code, but its not working. I can turn on/off the pins set as output directly. But I want to read the switch and its not working. Is there a problem with my configuration bits? The configuration is as shown below:
"__CONFIG(UNPROTECT & BOREN & MCLREN & PWRTDIS & WDTDIS & INTOSCIO);"
Please help its urgent and thanks in advance.
I tried "if(RC0==1){RC2=1; RC3=1;}" in the code, but its not working. I can turn on/off the pins set as output directly. But I want to read the switch and its not working. Is there a problem with my configuration bits? The configuration is as shown below:
"__CONFIG(UNPROTECT & BOREN & MCLREN & PWRTDIS & WDTDIS & INTOSCIO);"
Please help its urgent and thanks in advance.