I was rebuilding my team’s intake cargo hold and wanted to try to sense when a ball was in the cargo hold. I was wondering if it would be better to use a Distance Sensor, Touch LED, Bumper, or Color Sensor to detect a ball.
I would go for the bumper… any light load touching it will give a 1 when you get the value. Just make sure to place it somewhere where it is guaranteed to be pressed if you have load.
You can also use the IR-based proximity sensor on the Color Detector. By using the command getColorProximity(port#), you’ll get a value between 0-500ish (it can go as high as 1000 or so, but I’ve never seen it that high). Low numbers mean nothing’s there, high numbers mean lots of reflect IR light and thus an object that is nearby. This will allow you to detect the object without making physical contact.