Mithun_K_Das
Advanced Member level 3
- Joined
- Apr 24, 2010
- Messages
- 899
- Helped
- 24
- Reputation
- 48
- Reaction score
- 26
- Trophy points
- 1,318
- Location
- Dhaka, Bangladesh, Bangladesh
- Activity points
- 8,254
How can I use RB5,RB6 & RB7 to give some value output without disturbing other pins. I just want to generate a value 0 to 7 and need to show this value only those 3 pins. Note: Other pins are being used for other purpose. so I can't disturb them.
as I did:
unsigned char *I;
void main()
{
char I[2];
TRISB = 0x00;
PORTB = 0;
//I[1] = RB6_bit;
//I[2] = RB7_bit;
//TRISC = 0x00;
while(1)
{
RB5_bit = I[0];
RB6_bit = I[1];
RB7_bit = I[2];
I[0] = 1;
Delay_ms(100);
I[1] = 1;
Delay_ms(100);
I[2] = 1;
Delay_ms(100);
}
}
but its not working
as I did:
unsigned char *I;
void main()
{
char I[2];
TRISB = 0x00;
PORTB = 0;
//I[1] = RB6_bit;
//I[2] = RB7_bit;
//TRISC = 0x00;
while(1)
{
RB5_bit = I[0];
RB6_bit = I[1];
RB7_bit = I[2];
I[0] = 1;
Delay_ms(100);
I[1] = 1;
Delay_ms(100);
I[2] = 1;
Delay_ms(100);
}
}
but its not working