It should stop right at the line. Treads Line Sensor G2-SumoColor This program extends the G1-FindColor program to make the robot back up and turn when it sees a black line, and then the whole sequence is repeated in a Loop.
Now if you make a large black square or any shape with electrical tape on a light-colored floor and start Multi-Bot inside the box, it will try to drive around inside the box "bouncing off" the borders and staying inside. Staying inside an area marked with a colored border is the first step in playing a "Robot Sumo" game, where two robots try to push each other outside of the "ring".
You can play a simple practice Robot Sumo game with one Multi-Bot robot by placing various objects inside the ring with the robot, and see if Multi-Bot with an attachment such as the Sumo Pusher can push them all outside of the ring while staying inside itself.
Try changing the time of the back up and the angle of the turn in the LeftPivotAngle block to get different driving patterns and see which work best. Treads Line Sensor. Sumo Pusher Optional G3-ColorDrive This program can make Multi-Bot drive along a road or course marked by different colored borders which cause different actions, as follows: When the Color Sensor sees blue, Multi-Bot will turn left until it is off of the blue color. When the sensor sees green, Multi-Bot will turn right until it is off of the green color.
When the sensor sees Red, Multi-Bot will stop. All other colors will make Multi-Bot drive forward. If you start on a neutral-colored floor test to make sure the G3-ColorDrive program drives straight on it first , then you can use colored electrical tape, painters tape, or tape down strips of colored construction paper to mark the borders of the course. Put blue on the right border, green on the left border, and red at the end, and Multi-Bot will try to drive the course on its own.
If you put a black line with electrical tape on a light-colored floor, then Multi-Bot will slowly follow the line, even if the line has curves in it. Note that in this kind of line following, the robot is actually following the right edge of the line, not down the middle of the line as you might expect.
The robot tries to keep the black line just to the left of the sensor and the open floor to the right of the sensor, by zigzagging back and forth on either side of the edge, alternately seeing the line and the floor. This line follower is very simple but slow. Faster line following technique are shown in the Using the Light Sensor Mode section below.
You can use the Color Sensor in any configuration where it can get close to different objects. Hold it over objects of different colors to see and hear the results. Sensing small round objects is actually challenging for the Color Sensor, so you may find cases where the sensor reports the wrong color. In particular, red and green balls may be mistaken for yellow.
Give it a try and see how well it works for you. Now if you try the challenge with only blue, green, and red balls, it should be more reliable.
Start the program with the golfing arm in the straight down position, and a green or red ball in front of Multi-Bot so that it will enter the trap. Short carpet on the floor works best. In order to re-position the robot for hitting a ball after trapping it, the program uses a combination of Move and Motor blocks with the Duration set to certain Degree measurements. Learn more. Ask Question. Asked 5 years, 7 months ago. Active 2 years, 4 months ago.
Viewed times. I tried it with this code: package com. Improve this question. Richard Richard 21 1 1 bronze badge. Add a comment. Active Oldest Votes. First you have to be aware of these conditions: The color sensor should be about 1cm over the color. Viewed 5k times.
How can I do this?? Improve this question. David Lechner 8, 14 14 silver badges 52 52 bronze badges. Timbelion Timbelion 55 1 1 silver badge 5 5 bronze badges. Add a comment. Active Oldest Votes. Improve this answer. David Lechner David Lechner 8, 14 14 silver badges 52 52 bronze badges. How can i get orange color?? Thaddeus Hughes Thaddeus Hughes 1 1 silver badge 6 6 bronze badges.
Currently I am working Lego robot that solves 2x2x2 Rubik's cube, Thanks! The SmoothFollow program is a much more complex "Proportional Line Follower" which continually adjusts the steering response of the robot depending on how far off the line the robot appears to be.
If the robot is only slightly off of the edge of the line, then only a small amount of steering is applied. When the robot is exactly over the right edge of the line, the robot will drive straight ahead at the full power specified. This allows the driving to be smoother and faster than the LineFollow program.
In addition, the SmoothFollow program does an automatic "calibration" sequence at the beginning, where the robot scans the line and the surface to determine darkest and brightest light values to expect, so there is no need to manually determine a cut-off value. To get a proper calibration, start the robot with the sensor directly over the center of the line. Try designing your own course for the Line Follower, with a mixture of gradual turns and sharper turns. Electrical tape works well because it is dark, flexible, and leaves no residue when removed.
0コメント