Let's code the robot to sort different colored LEGO bricks
Let's now sort the LEGO bricks with this color sorting robot. First, find out the number of rotations needed by the external motor to do the following:
- Knock LEGO brick to the left tray:______________ rotations.
- Knock LEGO brick to the right tray:_____________ rotations.
- Allow LEGO brick to pass through at the blue tray:_____________ rotations.
Ensure that the hitter comes back to the original position after knocking the LEGO brick. The hitter is connected to port C and the conveyor belt is connected to port A.
Activity #1
Place a red LEGO brick on the belt. Now, move the belt until the color sensor senses this brick. Display the brick color on the screen. Now, move it further until it reaches a proper knocking position. Knock it to the left tray.
The sample code for this task is given here:
Let's repeat the same process...