Lab 6 1 (PDF)




File information


Title: cpre185-lab6-wiidrop(loops) 2011
Author: Thomas Daniels

This PDF 1.3 document has been generated by Microsoft Word / Mac OS X 10.5.8 Quartz PDFContext, and has been sent on pdf-archive.com on 25/04/2011 at 17:56, from IP address 173.26.x.x. The current document download page has been viewed 1303 times.
File size: 142.73 KB (2 pages).
Privacy: public file










File preview


Lab 6: Wiidrop
Objectives:



Develop problem solving skills
Develop skills in the use of numerous loops to solve a problem.

Process:
Creating a New Project in Visual Studio

Following the technique learned in Lab 1, create a new folder named Lab6 in your
cpre185labs folder on the U: drive.
Problem :
Understanding freefall is the basis of practical applications such as landing rovers on Mars (
http://www.youtube.com/watch?v=B6PUdWKWiBM&feature=related )as well as fun projects
such as Eggdrop competitions (http://www.youtube.com/watch?v=ADBTHpk0L8g ). This week,
we will develop an application that we will call Wiidrop to detect free fall and narrate the action.
At the end of the lab, you will put a wiimote into a foam football and drop it off of the 3rd
floor balcony in Coover. (FOR SAFETY, DO THIS ONLY UNDER SUPERVISION OF A
TA OR PEER MENTOR.)
Your code's output should look like the following.
I'm Waiting ....................................................
Help me!

I'm falling

!!!!!!!!!!!!!!!!!!!!!!!!

Ouch! I fell 8.997 meters in 1.355 seconds.
I'm Waiting ....................PLUS PRESSED, EXITING PROGRAM.

Each period on the “I'm Waiting” Line should correspond to some number of input lines
from wiiwrap. Try 10 or so to see what works well. The exclamations on the falling line
should work similarly. (Note: You may want to use a counter and mod (%) for this.
(Challenge version: output them approximately every k milliseconds.) Whatever you do,
be sure to use constants defined at the beginning of the program to specify how many
lines or seconds equate to one punctuation mark.
Lab Report Requirements
Do the same drop 5 times and record the distances. How consistent are your results?
What could cause any variation?
How far is it from the third floor railing to the bottom floor? We will do this in the second
lab session (next week). Have this program functioning by next week so we can add
some features.

If your program is not done by end of class, you can capture data wiiwrap data to a file
as shown below and then test your code by running wiidrop <file.csv
Demo your source code to a TA and have them initial a printed copy of the source. Be
sure your comment your code and functions that you write.
In your report, include a diagram of your algorithm and explain any tolerances you are
using.
Development Tips
Many loops in this program read and throw away data from the wiimote until some
condition is met. Do one loop and see if it works, then add another feature and see if it
works. Don't try to write it all at once!
The tee command can be used to capture the data your program sees:
wiiwrap /T /A /B | tee file.csv | wiidrop
will write the output of wiiwrop to file.csv as well as passing it on to your program
(wiidrop).
Capturing data to a file by wiiwrap /T /A /B >file.csv will allow you to then click on file.csv
and look at your data in excel. This can be helpful in planning your solution.
Feel free to use any functions from past assignments.
Needed Equations
1 2
gt where v is the initial velocity (0) and t is the fall time. X1 is the location
2
before and x0 is the location after the fall.
x0 = x1 + vt +

g = 9.8 m/sec^2






Download Lab 6 - 1



Lab 6 - 1.pdf (PDF, 142.73 KB)


Download PDF







Share this file on social networks



     





Link to this page



Permanent link

Use the permanent link to the download page to share your document on Facebook, Twitter, LinkedIn, or directly with a contact by e-Mail, Messenger, Whatsapp, Line..




Short link

Use the short link to share your document on Twitter or by text message (SMS)




HTML Code

Copy the following HTML code to share your document on a Website or Blog




QR Code to this page


QR Code link to PDF file Lab 6 - 1.pdf






This file has been shared publicly by a user of PDF Archive.
Document ID: 0000030266.
Report illicit content