koolguy
Active Member
Hi again,
I was testing a two seven segment display multiplexed with PIC16F72, the problem is that i am using two switch for Up and down the counter. The seven segment look table is made in array.
which is working fine with for loop.
But now i want to up the counter with pressing the switch and down.
for this this code is not working fine pull down Resistance is used for reference values.
I was testing a two seven segment display multiplexed with PIC16F72, the problem is that i am using two switch for Up and down the counter. The seven segment look table is made in array.
which is working fine with for loop.
But now i want to up the counter with pressing the switch and down.
for this this code is not working fine pull down Resistance is used for reference values.
C:
char data[12]={0xDE,0X50,0b10111010,0b11111000,0b01110100,0b11101100,0b11101110,0b01011000,0b11111110,0b11111100} ;
main()
{
TRISB = 0 ;
TRISC = 0 ;
ADCON0=0X00;
ADCON1=0B11111111;
TRISA = 0b11111100 ;
__delay_ms(500);
unsigned char a=0;
while(1){
PORTA=0b00000010;//digit one multiplex
PORTB=data[a];// counter loaded value
__delay_ms(10);
PORTA=0b00000001;//digit one multiplex
PORTB=data[0]; // just used for test working fine or not
__delay_ms(10);
if(RA2==1){
__delay_ms(400);
a=a+1;
}
if(RA3==1){
__delay_ms(400);
a=a-1;
}
}
}
Last edited by a moderator: