Problem Description
Problem 1: Start / Finish Line (Hardware Level 1 Software Level 4)
The Olympic committee would like your team to invent a control system for use with track and field running events. They want this device to automatically record the time and flash an LED when the first runner crosses the start / finish line.
We simulated both a physical and programming solution to the problem. For the programming, we had to have a timer run, and then when a runner crossed the line, the timer would have to stop and make an LED flash. Our program does exactly that. It has a timer running since the start, and when a sonar detects a runner crossing under the designated area, the timer is made to stop and an LED is made to flash. For the physical model, we had to simulate a racetrack, with a runner crossing through a finish line, and include an LED somewhere so it could flash when they crossed the line. Our model had all of those things. We just replaced the runner with a small car-like object, instead of a real runner. We do have a scaled-down finish line for it to go through, and an LED to flash when it crosses.
The Olympic committee would like your team to invent a control system for use with track and field running events. They want this device to automatically record the time and flash an LED when the first runner crosses the start / finish line.
We simulated both a physical and programming solution to the problem. For the programming, we had to have a timer run, and then when a runner crossed the line, the timer would have to stop and make an LED flash. Our program does exactly that. It has a timer running since the start, and when a sonar detects a runner crossing under the designated area, the timer is made to stop and an LED is made to flash. For the physical model, we had to simulate a racetrack, with a runner crossing through a finish line, and include an LED somewhere so it could flash when they crossed the line. Our model had all of those things. We just replaced the runner with a small car-like object, instead of a real runner. We do have a scaled-down finish line for it to go through, and an LED to flash when it crosses.
Brainstorming
In the Design 1.1 Sketch, the runner would run through the finish line, the sonar would detect him when he came within a certain horizontal distance, and then the LED on top of the finish line would go off, and the timer would stop. The cortex and battery would be off to the side.
the Design 1.1 Description says: "For this design, the runner will run up the track towards the finish line. when they cross it, the sonar will detect that they have crossed it , and set off the LED and stop the timer. Since the LED is located on top of the finish line, it would need a device to connect it to the cortex. Also, the timer will have been running since the start of the race. "
In the design 2.1 sketch, the runner would run under the finish line, and then the sonar would detect them when they came within a certain vertical distance. The LED would flash, and the timer would stop. The cortex is placed on top of the finish line so that its wires can reach the sonar more easily.
The Design 2.1 Description says "For this design, the tier will have been running since the start of the race. When a runner crosses the finish line, the sonar will detect it, and stop the timer and start the LED. In this design, the cortex is placed on top of the finish line, and the LED can flash without an outside device. The sonar's cables can also reach it more easily. "
Design 1.1 basically suggests making time a variable, and then always setting to zero, then adding 1 for every second. If the sonar detects an object closer than the value we specify, it would stop the variable at the current value, and then make the LED flash.
The Design 1.1 Description says: " Make time an integer and set it to zero, then add one to the variable for every second, until the runner crosses the line. "
The Design 1.1 Description says: " Make time an integer and set it to zero, then add one to the variable for every second, until the runner crosses the line. "
The Design 2.1 Code start out with clearing the timer. Then, the program will always go on to start the timer. then, when the sonar's value becomes less than 2, time would stop. Then, the LED would always turn on and off. The problem was, that we were using the wrong commands; TimeStart and Stop aren't real commands.
Here is a design 2.1 Flowchart, illustrating what was happening with the 2.1 Code.
This is the Design 2.1 Description. It reads, "First the program would clear the timer, then it would start it. When the sonar's value became lower than 2, the timer would stop and the LED would turn on ."
This is the Design 3.1 Code. First, the LED is turned off, then X is made into a variable, and the DebugStream and timer are cleared. Then, the program will go on to set X equal to time, and convert it into whole seconds. Then, the program is told to write the line " The sonar value at %d seconds is %d, putting in X and the Sonar's value for the %ds. When the sonar's value becomes lower than 2, the program will flash the LED.
The Design 3.1 Description says, "first the program turns the LED off, then makes ab integer X, and then clears the DebugStream and the timer. Then X is set equal to time, and its modified so that it will be in seconds. It would write the lie "The sonar value at 0 seconds is [blank]", then wait 1 second and write it again, until the sonar value was less than 2, after which it would stop writing it and turn the LED on. "
The design 3.2 Description says, "We made some modifications ti fit our physical design. We made the sonar turn the LED on when it sensed an object within 7 inches instead of 2, and we changed the DebuggerSteamLine to ("The runner crossed the lien at %d seconds, X). "
This is the first half of the 3.2 flowchart. It basically says exactly when the descriptions above say.
This is the second half of the 3.2 flowchart. It basically says exactly when the descriptions above say.
Physical Solution
This is our physical solution. It works like so; the runner comes down through the guide rails, and then the sonar detects it when it crosses the finish line. The barrier stops it from falling off the edge. When the sonar detects the runner, it stops the timer on the computer screen, and flashes the LED.
More detailed labels and component descriptions can be found on out Animoto video, here: https://animoto.com/project/jbHaVMNqULMYm1qS1wvvDQ
More detailed labels and component descriptions can be found on out Animoto video, here: https://animoto.com/project/jbHaVMNqULMYm1qS1wvvDQ
Programming Solution
In lines 3-5, the devices are registered, thee being the sonar, LED, and DebuggerWindow.
In lines 9-12, the LED is turned off, x is made an integer, and the debug stream and timer are cleared.
In line 15, X is set equal to time, and it is modified to show up as whole seconds.
In lines 16-18, the debugger stream is told to write the line, " the runner crossed the line at %d second", every second until the runner crosses under the sonar, filling the time in seconds for %d.
In lines 22-25, the Led is told to flash.
More detailed labels and component descriptions can be found on out Animoto video, here: https://animoto.com/project/jbHaVMNqULMYm1qS1wvvDQ
In lines 9-12, the LED is turned off, x is made an integer, and the debug stream and timer are cleared.
In line 15, X is set equal to time, and it is modified to show up as whole seconds.
In lines 16-18, the debugger stream is told to write the line, " the runner crossed the line at %d second", every second until the runner crosses under the sonar, filling the time in seconds for %d.
In lines 22-25, the Led is told to flash.
More detailed labels and component descriptions can be found on out Animoto video, here: https://animoto.com/project/jbHaVMNqULMYm1qS1wvvDQ
Reflection
I learned how to do more complex programming tasks, such as showing time through using the debugger stream, and converting time into seconds using math commands.
A few things went wrong that we needed to fix. We had problems with both the programming and physical building aspects of the project. with the programming, we had difficulty finding a way to make time be visible to the controller, and more difficulty finding a way to make the timer stop. We solved this problem by making a variable equal to time, and then having the debugger window show us the variable every second while the sonar didn't detect a runner going under it. With the physical model, the only problem we had was making the runner run directly under the sonar. We solved this by installing guide rails to direct the runner under the sonar.
We were ale to fix everything that needed to be fixed.
The teamwork was good, I felt like we worked in a timely and comfortable manner, and I feel that each one of us contributed to the brainstorming and building process.
If I had to do it over, I would want to change the debugger stream line somehow, to make it only show up once, when the runner crossed the line. However, I have no idea how I would do that.
A few things went wrong that we needed to fix. We had problems with both the programming and physical building aspects of the project. with the programming, we had difficulty finding a way to make time be visible to the controller, and more difficulty finding a way to make the timer stop. We solved this problem by making a variable equal to time, and then having the debugger window show us the variable every second while the sonar didn't detect a runner going under it. With the physical model, the only problem we had was making the runner run directly under the sonar. We solved this by installing guide rails to direct the runner under the sonar.
We were ale to fix everything that needed to be fixed.
The teamwork was good, I felt like we worked in a timely and comfortable manner, and I feel that each one of us contributed to the brainstorming and building process.
If I had to do it over, I would want to change the debugger stream line somehow, to make it only show up once, when the runner crossed the line. However, I have no idea how I would do that.