Prior to building our mini sculpture, we decided to play around with the parts and get familiar with the different components. After, we put together a series of different contraptions to see how each component can perform.
This is a quick demo of the color sensor mechanism. When a dark-colored marble passes through the sensor, the track will remain still and the marble will continue straight. When a light-colored marble passes through the sensor, the track will drop and the marble will return to the elevator.
For our sculpture, we used RobotC to program two NXT Corteses: one for the Color Sorter and the other for the human interface. The first flow chart explains the code we used for the Color Sorter. The sensor is continuously checking if the touch sensor is pressed or if marbles are passing by. If it is a warm color, the motor is turned on to move the ramp down so the marble can fall. If it is a cool color, the motor is turned off, and the NXT keeps checking the touch sensor. For the Switcheroo, the NXT checks if the touch sensor is pressed and decides what direction to turn in. There is a boolean, which is a true or false variable, that says if the ramp is facing the left or right. Based on this, the ramp moves to face the opposite direction.