embed_con
Newbie level 1
- Joined
- Jun 6, 2011
- Messages
- 1
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,290
hiii;
i have some code in that , read the sensor data on switch.
i think logic is ok but confusing about o/p.
tell me the output of this code.
i have some code in that , read the sensor data on switch.
i think logic is ok but confusing about o/p.
tell me the output of this code.
Code:
struct sen
{
U8 s_id;
U8 sed;
}infor;
int Read_id(int DS)
{
int id;
DS = DIP_SWITCH;
switch (DS)
{
case 0:
id = SENSOR1;
break;
case 1:
id = SENSOR2;
break;
case 2:
id = SENSOR3;
default:
id = -1;
break;
}
return id;
}
int Read_current_id(int curr_id)
{
curr_id = Read_id(infor.s_id);
return curr_id;
}