# Ball launch

Spring 2019

The questions below are due on Sunday February 24, 2019; 11:59:00 PM.

You are not logged in.

Note that this link will take you to an external site (https://oidc.mit.edu) to authenticate, and then you will be redirected back to this page.

## 1) Overview

In this Design Exercise, you will use the IMU's accelerometer to launch the ball created in the ball game from Exercise 02. By moving the embedded system, you will impart the initial trajectory on the ball. Kind of like for the Wii:

## 2) Spec

Instead of hard-coding the initial trajectory of the ball (or making it random like in ex02), we will use trajectory of the system. Starting with a single ball somewhere on the screen (it's up to you to decide where it goes), when you want to start, you push and hold the button down. You then move the embedded system in a certain direction at a certain velocity/acceleration and when you release the button the ball should start moving in that direction based on your velocity at release.

This will be much easier to implement if you keep the embedded system flat on a desk or table and just move it in a 2-D plane. If you want to try it in 3-D space so much the better, but realize it is MUCH harder both from an IMU-processing perspective and from how you'd even go about visualizing the effect of that in the low-resolution 1.8" screen of our LCD.

Your ball should bounce of the walls and incorporate viscous friction and lossy reflections off of walls, like we did in Exercise 02 (basically you don't need to change it from what you got working). It's up to you to figure out what parameters to record during the initial motion (position, velocity, acceleration? all three? just the end values? average values?) so that a realistic motion occurs, but you'll need to succintly explain that in your design exercise description below.

While the ball is bouncing around, if you press and hold the button again, a second ball should appear on the screen and you can repeat the process, now with two balls moving around (the first ball keeps going on as it was, and the second ball follows the latest trajectory). Don't worry about implementing collisions. You should be able to do this for up to four balls. You can stop at four balls, or you can keep going. It is up to you.

How you implement more than one ball simultaneously is up to you. Consider modifying our Ball-related functions to use pointers in a way similar to how the scrolling text functionality was fixed when we transtioned to three simultaneous scrollers in the supporting code from Lecture 01, and then using more globals (or arrays of global variables) to hold the system states (position, velocity) of multiple balls.

You should implement a way to reset the game, i.e., remove all the balls and start over...Without unplugging or resetting the entire system, that is. Your system can have at most two pushbutton switches on it.

Small Modification to Spec from Tuesday Evening: Please use only buttons connected to pins 16 and 5!!!

When your system is ready, create a short video of it working and displaying the different behaviors above, and a copy of your ESP32 code.

You can upload your video to Youtube or any other site that is accessible by the staff.

Any late factors are based on the timestamp for the last time that the URL is entered on the page or when the code is uploaded or when a comment is added/changed. If you change your URL after the deadline you will incur a late penalty. If you upload code after the deadline, you will incur a late penalty. If you comment after the deadline, you will incur a late penalty. One-Week Extensions DO NOT APPLY Design Exercises.

You must upload all code that you used in your design. Failure to upload code will result in signifcant point loss. This includes if you just forgot. Screenshots of your file's last modified date in My Computer are not evidence that the file has not been changed. They must be uploaded.

Problem Status:
A Python Error Occurred:

Error on line 2 of python tag (line 48 of file /S19/ex03/ball_launch):



Enter the url for the video

Submit all of your code below in one file:

No file selected

Enter any comments you may want us to know about. For example, if you started this exercise but don't want it graded, make a note here. Please hit submit on this question even if you don't have any comments.

This problem will not be marked as done until graded by the staff. If you have filled it out, it will appear as with a note saying "Work Submitted" on the main ex03 page.

This page was last updated on Sunday March 10, 2019 at 03:42:51 PM (revision 2aaaaf2).