For this third challenge we attached sensors that detected changes in color and brightness to the front of the car, one on each side (sensor 1 on the right, and 2 on the left). The sensors look like this:
Our thinking was to start with one sensor on each side of the line and have the car swerve left and right to find the line. This ended up being a good idea, and our robot worked well!
Unfortunately, our professor was less than impressed. Our next challenge was to make our robot able to pass a sobriety test. This was a little more complicated, but after a little bit of thinking we came up with this program:
Now, our robot goes straight until it finds a turn in the line, at which point it turns in the direction of the side with the sensor that detected the change in light as it found the black line. Then it goes straight again. Any policeman would be proud of this safe, sober driver!
No comments:
Post a Comment