No announcement yet.

Modern Robotics Color Sensor--No Data

  • Filter
  • Time
  • Show
Clear All
new posts

  • Modern Robotics Color Sensor--No Data

    Hello all!

    Our team is having trouble getting data from the Modern Robotics Color Sensor. When plugged in, the sensor gives a telemetry reading of 0; when it is unplugged, it gives a telemetry reading of 255 for red blue, green, and alpha (hue stays at 0). We have tried to change the code in various ways, but with minor differences, the same problem occurs.

    As per the suggestion of Philibot, I have included the following information:

    1. We are using:

    Modern Robotics: Core Device Interface, Core Motor Controllers, Core Power Distribution Module, Color Sensor, Servo Controller.
    Tetrix: 12v Motors
    HiTec: Servos

    2. ZTE Speed phones.

    3. We transferred the FTC app to the phone by downloading the SDK from GitHub.

    4. Auto run is off.

    5. The version of the Robot Controller app is 4.1.

    6. No trouble configuring the robot.

    7. We have replaced our color sensor to a Modern Robotics color sensor.

    8. Yes, we are using the example code.

    9. This issue doesn't involve any crashes or such things.

    Thank you!

  • #2
    By the way, we use Android Studio.


    • #3
      I assume you misspoke on point #3. The robot controller app has to be downloaded from your computer to run the opmodes you created.

      Are you plugging in the color sensor with the black wire next to the black stripe which indicates the ground side?

      Is the light on?

      Are you holding the sensor close to a surface?

      Is there a possibility that you changed the color sensor address from its default?

      You can use the MR Core Device Discovery Windows program to test the color sensor, and find out its address to see if it is at the default of 0x3C

      Sensor addresses and codes

      Basically plug the DIM into the PC start the program, hit the refresh, select advanced for the DIM, type 0x3C into the address, type 0x08 into the register, check poll, see white values. See table in 2nd document to find other registers to read.


      • #4
        Thank you!

        Yes, we are plugging the sernsor in correctly.

        Yes, the light is on.

        We were holding the sensor close to a surface.

        Yes, we changed the address, but it is 0x3c now, and all values read 0 when the example program is running.


        • #5
          See if the sensor is working. Download the MR Windows program as I described above and see if you get values from the color sensor there.


          • #6
            Thank you for providing the links! I attempted to read the color number (0x09). I put in the following text: Address: 0cx3c, Register: 0x09, and I hit poll read and got 0 as the value when the color sensor was plugged in, and 255 when it was unplugged (what happened when running the example code). Does this mean the sensor is faulty or broken?


            • #7
              Is the address that you typed in the same as the one reported on the i2c list of connected devices?
              Is the light still on?
              How far are you holding the sensor from a surface? Less than an inch is better.
              If none of the above I would suspect a bad sensor. Is there anyone nearby that you can borrow one to double check?


              • #8
                Yes, the address is the same as on the i2c list.

                The light is still on.

                We are holding the sensor less than an inch away from the surface.

                We have a HiTechnic Color Sensor, but unfortunately, not another MR Color Sensor around.

                Thank you!