Hi,
I was testing this code for counting but the variable count is not putting its value to PORTB, why??
I was testing this code for counting but the variable count is not putting its value to PORTB, why??
Rich (BB code):
#include <htc.h>
__CONFIG(LVP_OFF & BOREN_OFF & PWRTE_ON & WDTE_OFF & FOSC_HS);
#define _XTAL_FREQ 20000000
#define SW RB7
char count;
main(){
SW=0;
count=0;
while(1){
if(SW==1){
++count;
PORTB=count;
}
PORTB=count;
}
}