[Urgent] Sensor Splitter on lejos ev3
 Software and Programming Related   Started by Miriam   2016-06-29 02:59:11 -04:00   Comments: 2    Viewed: 453

  1. Miriam
    Miriam Member
    Hi everyone
    I am developing some program for my robot competition a few days after, so please help me.
    i get a SPLIT-Nx-v2 from my teacher and use it to connect a HT Color Sensor and mindsensors LSA, however, when i opened the same port 3 for these sensors in my program as usual, the program states an error when it is exceuted on the ev3. Here are my codes.

    MindsensorsLightSensorArray ASensor = new MindsensorsLightSensorArray(SensorPort.S3,20);
    HiTechnicColorSensor2 FSensor = new HiTechnicColorSensor2(SensorPort.S3,2);

    I uses my own implenatation on the HT Sensor as i didn't find the address parameter in the original implentation. Here are some related parts of them. I just changed the constructor.

    public HiTechnicColorSensor2(Port port, int address){
    super(port, address);
    init();
    }

    public HiTechnicColorSensor2(Port port) {
    this(port, FACTORY_DEFAULT);
    init();
    }

    It states
    lejos.hardware.DeviceException
    unable to open port

    Please help me to solve the problem, thanks.
     
    Miriam, 2016-06-29 02:59:11 -04:00
  2. Deepak Patil
    Deepak Patil Administrator Staff Member Richmond
    I uses my own implenatation on the HT Sensor as i didn't find the address parameter in the original implentation. Here are some related parts of them. I just changed the constructor.
    Hitechnic sensors have fixed I2C address (i.e. can not be changed) so a constructor where you can change address is not useful.
    Deepak Patil, 2016-06-29 06:24:43 -04:00
  3. (You must log in or sign up to post here)

Log in | Sign up
Tems & Conditions!
Help!