Sunday, May 16, 2010

LogoChip Challenges [FC.4,5,6]

[FC.4 Simple Distance]
&
[FC.5: Simple Back and Forth
]



Here is our code for "Simple Distance" and "Simple Back and Forth." For the simple distance challenge, we just had the MotorCar move forward to a given time (wait of 130) and brake. For back and forth method, we applied the same idea. It was our first encounter with the wait variable and how powerful of a tool it was.

Here is a video for "Simple Back and Forth."




[FC.6: Distance with Bang-Bang Control]



For this challenge, we first measured the time it takes for the MotorCar to go for 10 feet, which we found to be approximately 13 seconds. Because we were supposed to use coast and not brake, we shortened the time by 1 sec because the car moved a bit forward after it has coasted. By using the variables, counta and countb, under the condition for "If" statement, we would have it either perform side-bang-bang control or move forward. The MotorCar moved very straight, which made us happy, but it stopped before it reached the end point. We discovered that controlling the distance only with timer was limited and the distance varies all the time depending on the condition of the floor.

Here is a video of our "Distance with Bang-Bang Control."


No comments:

Post a Comment