In order to create this procedure, we made two programs (one for the forward directionand the other for the reverse direction). This a picture of these two programs, entitled "2ftfor" and "2ftback":
We then combined them under our "bandf" program (back and forth). We remembered to add a wait of .2 seconds in between the two directions. We also remembered to put a "stopstack" block at the end of both our programs so that they would hand over the control.
We saw that when the car reversed and went towards its original location, it didn't quite make it. It about an inch to go before it attained its original starting position. To fix that, we can alter the count on our"2ftback" program.
We then test our program with the car starting uphill on the ramp. As the car moved up, it didn't make reach the 2 feet mark. As the car reversed, it went passed its original location by a couple of inches.
When we started the car going downhill, the car passed the 2 feet mark and as it tried to reverse, its skidded for a couple of seconds and proceeded to travel back up, but it did not reach its original location.
After that, we created a program that would repeat this process 3 times. This is what our program looked like:
No comments:
Post a Comment