PDF ArchiveHistorical archive . public document
2011 . April . 25

cpre185-lab6-wiidrop(loops) 2011

Lab 6 - 1.pdf . by Thomas Daniels

PDF 1.3 2 pages 142.73 KB Filed 25/04/2011
Download this PDF
Lab 6 - 1.pdf
Web reader . 2 pages
Page 1 of 2, Lab 6 1
1 / 2

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 . 2 pages

Download PDF

File information

File name
Lab 6 - 1.pdf
Title
cpre185-lab6-wiidrop(loops) 2011
Author
Thomas Daniels
Size
142.73 KB
Pages
2 pages
PDF version
1.3
Produced with
Microsoft Word / Mac OS X 10.5.8 Quartz PDFContext
Filed on
25/04/2011
Page views
1 303
Document ID
lab-6-1
MD5
30917206bf53737306b9bae310ee7401
SHA-512
0576e00e2fee9e6e14e0c12c2aaa72742c3a823f9c8b67177b62d06f757de4a92c5df7aa624cebdacd481afe3f63a70ca833aaeb07fc1dcf2e8824315651cb28

Share this document

This address never changes. It is the one to keep, to send, or to cite.

Shorter, for a text message or a post with a character limit.

To link to this document from a website or a blog.