I wish I could say I did this lab because I felt so ahead of the game and needed a challenge. The real reason I did it this week is because I read the wrong lab first. But! I got it working with two potentiometers and a switch, however, I’m unsure of the necessity of the switch in this particular case.
I had to fudge a few numbers, since this code was written for use with an accelerometer. If I left the values as they were, I kept getting an “out of bounds” error. I had no trouble reading in values of a max of 1023, but neither potentiometer would go below about 600, although I expected to see values as low as 0. This didn’t seem to affect the ability for the ball in the graphic to span the entire screen, but I have no idea why. I thought you had to hold down the switch as you adjusted a potentiometer in order for full functionality, but the switch didn’t seem to make much of a difference.