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.
|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|
\ / /\__/\ \__=( o_O )= (__________) |_ |_ |_ |_Course Site powered by CAT-SOOP 14.0.4.dev5.