ruben91
Junior Member level 3
- Joined
- Nov 17, 2014
- Messages
- 29
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 209
[PIC] if else convert to case problem
i have some difficulties i converting if else to switch statement
pls help me with this, is it posibble to use variable case?
i have some difficulties i converting if else to switch statement
pls help me with this, is it posibble to use variable case?
Code:
if(distance>=0 && distance<=250)
{
LATDbits.LATD0=1;
}
else if(distance>=251 && distance<=500)
{
LATDbits.LATD0=1;
Delay10KTCYx(25);
LATDbits.LATD0=0;
}
else if (distance>=501 && distance<=1000)
{
LATDbits.LATD0=1;
Delay10KTCYx(25);
Delay10KTCYx(25);
Delay10KTCYx(25);
LATDbits.LATD0=0;
}
else
{
}