Why are Vex IQ sensors so bad (or is it just my team's)

I tried color sensors, they didn’t work
I tried Distance sensors, they didn’t work
And my gyros think a 90 degree turn is infinitely spinning
Are these just my teams Vex IQ sensors or are the all Vex IQ sensors

1 Like

Could you send the code that you used for the sensors?

2 Likes

Sorry you are having problems. Lots of teams get the sensors to work. Why not post your code and we can try to help you figure it out.

7 Likes

I have not had code for sensors in a while but, here’s an example
Forum.iqcpp (2.2 KB)

The code as you have posted it is very unlikely to do anything.
You are checking once in a fraction of a second if the Colour Sensor can see something that is within the yellow threshold. The chances of that happening are slim.

So in this case, it is definitely not a case of the sensor being so bad, it is your code that is the problem.

With the Colour Sensor, you are probably better off using the Hue function rather than the presets. This way you can calibrate your code to match the objects that you are trying to detect, with both an upper and lower hue threshold.
You’ll also need to be reading the data more than once, so you’ll probably want some kind of loop:

These thresholds are arbitrary numbers, not the actual values for your yellow object.

  // Begin project code
  while(true){
    if (Visor.hue() > 90 and Visor.hue() < 130){
    //Vision sensor is in the yellow threshold
    Spinner.spin(forward);
    }
    wait(20,msec)
  }
}
3 Likes

Thank you, I will try this at practice today.
Already have the code ready.

What about the gyros

Can you be more specific? The gyro is incredibly important and almost every robot will have one on.

My team’s gyros when you run them in auton spin forever and ever.