# Getting our Angle

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.

Back to Exercise 03

Angels and Angles

## 1) Frame of Reference

Over the next few weeks we'll be building onto our Ball simulator that we started last week to make a game and some other things. In order to add an intuitive sense of control to the system we're going to make the ball's rolling be responsive to the IMU which we start working with in Lab 02A. Today we'll just do a little introduction and in the next few weeks we'll build on it.

What we'd like to do is have the IMU control the "ball" that you created in the previous exercise via gravity. We'd like the acceleration readouts from the IMU to apply a force in the correct axis of the ball so that if we tilt the device to the right, the ball goes right, if you tilt the device downward, the ball goes downward, and so on.

Download the code found here which brings in the IMU, and uses the IMU readout to control the ball. Get it working with your system so that it works as specified above; you should be able to tilt your device and have the ball roll around as if it is actually responding as a ball with mass should to gravity. You need to add your two final working functions from Ex02, and be sure to read through the code since we'll use it in the future, but you should see it is almost identical to the code from last time where the buttons stimulated the ball! There is no checkoff for this exercise other than the question below, but make sure you get this working because: A) It is fun, and B)You'll need it in future weeks and even for design exercises this week.

Take a look at the system photo up top. This is a photo of Joe's setup. When Joe first put the downloadable code onto his device the ball did not act correctly and he was sad because he gets really invested in these sorts of things. What was wrong? Pick the most appropriate response from the list of options below based on your own experience and in looking at how Joe's setup is constructed.

Why didn't Joe's ball work correctly right away?
 The X reading was fine. Y was negative of what was needed. The Y reading was fine. X was negative of what was needed The X and Y axes were swapped with one another, but were the right sign. The X and Y axes were swapped with one another, and both had the wrong sign. He was on Mars and gravity is different there

Back to Exercise 03

This page was last updated on Monday February 18, 2019 at 03:19:34 PM (revision 2ec2c33).