I’m programming my VexIQ clawbot with ModKit. I’d like have it programmed so that when the color sensor detects a black line, it reverses. I used two scripts which are below. To detect the darkness I decided to use the greyscale % setting of the color sensor. I’ve attached pictures of the two scripts below. The problem is that:
With the script that uses the “=” sign I can’t be sure exactly what percent the dark line is at given that the shade changes from one part of the black line to the other because of lighting. So the “else” part responds but the rest of the script doesn’t. But given that the percent has the to be a specific amount can make it challenging to program… So I also tried the less than script.
When I tried the “<” script I get a message saying something along the lines of color not defined. I forgot the exact wording as I don’t have the robot here with me at the moment and it also told me to contact ModKit staff, but I’m hoping someone here has an answer in case there’s something wrong with the logic of how the program is put together.
Please respond as soon as possible, I hope to be able to teach the solution to a bunch of kids this Saturday.
Thanks