Here I introduce Whiney, our beloved robot for these challenges.
Our first challenge is to make Whiney follow a line. We used a simple algorithm to create this program. Whiney would turn until one way until the sensor on the side opposite the way he is turning sees the black line. Once this happens. Whiney turns the other way until his other sensor sees the black line. Though the algorithm seemed fairly simple, my group faced many problems along the way. For one, we discovered halfway through the class that one of our sensor ports on the robot was not working. We were trying, for a while, to figure out why our sensor barely detected a difference between black and white surfaces. We changed the resistors and still the error persisted and in fact got worse to the point where the sensor no longer detected any difference between the black and white sensors.
When we switched this sensor to another port, the sensor began working fine thus we inferred that sensor port 2 had malfunctioned. After overcoming this difficulty and other minor coding difficulties, we got Whiney to run a beautiful line following program as shown below.
Our Line Following Program |
The code we used to test our "blackness" thresholds for each sensor |
After running this program, Whiney was correctly able to follow a line.
No comments:
Post a Comment