Challenge 1 - Back Up:
We used the bumper sensor on our Sciborg to create a program that told the robot to go straight until it hit something and then back up for one second.
Challenge 2 - Escape:
The second challenge was to create a program that would allow our SciBorg escape from the middle of a bunch of obstacles. We implemented the code from our first challenge and added a turn after the SciBorg backs up. And then it continues to go straight. Then it waits for the SciBorg to bump into something again and it runs the whole program again.
Ignore the [reset countb] block, we had accidentally left that in there from something we were trying earlier... |
[Like the song from Hercules!!!] <----click ^-^
The third challenge was to make our SciBorgs travel in a straight line a certain distance (1.5 meters), and then come to a stop. We accomplished this in three different methods.
----Method 1 - Counter-----
The first method we used to accomplish this task of going the distance was implementing the wheel counters. The LEGO motors have built-in counters that keep track of how many times the wheel has turned. We used the data from these counters to tell the robot to stop after one of its wheels had turned a certain number of times. To figure out how many times the wheel would have to turn to go 1.5 meters, we made intelligent guesses and checks to figure out that it would have to turn about 1500 times.-----Method 2 - Timer-------
The second method we used was implementing the timer. We estimated how much time it would take to go 1.5 meters in a straight line, and wrote our program accordingly. Guessing and checking led us to the time we used: 40 seconds to go 1.5 meters.------Method 3 - Detecting the Finish Line-------
The third and perhaps the best method we used implemented the light sensor on our robot. We used this light sensor to differentiate between the dark gray floor and white electrical tape. We set two pieces of tape, one black and the other white, 1.5 meters apart. The robot is placed at the black tape and is programmed to go straight until the sensor sees the white tape (the finish line!!).
Here are the yellow blocks we created and used throughout the programs:
No comments:
Post a Comment