varunme
Advanced Member level 3
How can I rewrite the below code so that , i can make two input bits high at the same time ?
or this code will work when we press two switches simeltanously ?
Code:
void main() {
trisd=0;
trisc=0xff;
while(1)
{
if(portc.f0==1)
portd.f0=1;
else if(portc.f1==1)
portd.f1=1;
else if(portc.f2==1)
portd.f2=1;
else if(portc.f3==1)
portd.f3=1;
else if(portc.f4==1)
portd.f4=1;
else if(portc.f5==1)
portd.f5=1;
else if(portc.f6==1)
portd.f6=1;
}
}
or this code will work when we press two switches simeltanously ?