Hello, I am a student and my friends are doing a project, I want to help them.
My friend told me that his problem is that he can't set up his color sensor to detect three separate colours using logic gates, he can only do either black or white, but he wants to differentiate between black, white and any other colour using logic gates, how can he do that ? with this color sensor logic gate thingy with 1's and 0's
You could try a comparator with an adjustment on its threshold (the voltage to which the sensed voltage is compared) to account for the reduced light getting through the color filters that is neither bright nor dark, but in between.
You haven't said what family of logic you are using. Let's assume it is CMOS at 5V. The switch points are 1/3 and 2/3 of the supply voltage. Now, let's further assume that you can manipulate your color filter so its output is exactly half of what no filter gives. Darkness (not color, not light) is set to give less than 1/3 the supply voltage.
Then arrange your logic so color is "not light" and "not dark" (inverting the dark might help). Here's one approach. There are many.
While there are many solutions, the key is that color will not be light and will not be dark.