read the sensor data on switch

Discussion in 'Embedded Systems and Microcontrollers' started by embed_v, Jun 6, 2011.

  1. embed_v

    Thread Starter New Member

    Aug 30, 2010
    24
    0
    hii this my code :

    my logic is that i have to read the current sensor data on appropriate dip sw.
    for that i define the structure for sensor ,also int Read_sensor_id(int Dip_Switch) for to read sensor data on sw.
    but when i complied the err occoured:

    Error: L6200E: Symbol infor multiply defined (by delay.o and commands.o).
    Error: L6200E: Symbol infor multiply defined (by i2c.o and commands.o).
    Error: L6200E: Symbol infor multiply defined (by sensor.o and commands.o).

    i think logic is ok but somthing wrg in structure....?????????


    Code ( (Unknown Language)):
    1.  
    2.  
    3. struct sensor
    4. {
    5.     U8 sensr_id;
    6.     U8 opto_read;
    7.      
    8. }infor;
    9.  
    10. int Read_sensor_id(int Dip_Switch)
    11. {
    12.     int sensor_id;
    13.        Dip_Switch = DIP_SWITCH;    //4bit dipsw
    14.     switch (Dip_Switch)
    15.     {
    16.     case 0:
    17.         sensor_id = SENSOR_ID0;
    18.         break;
    19.  
    20.     case 1:
    21.         sensor_id = SENSOR_ID1;
    22.         break;
    23.     case 2:
    24.         sensor_id = SENSOR_ID2;
    25.  
    26.     default:
    27.         sensor_id = -1;
    28.     break;
    29.     }
    30.  
    31.     return sensor_id;
    32. }
    33.  
    34. int Read_sensor_current_id(int curr_id)
    35. {
    36.     curr_id =  Read_Cassette_id(infor.sensr_id);
    37.  
    38.     return curr_id;
    39. }
    40.  
    41.  
    42.  
    43.  
    44.  
    45.  
    46.  
     
Loading...