Find answers to your most challenging questions with the help of IDNLearn.com's experts. Get accurate answers to your questions from our community of experts who are always ready to provide timely and relevant solutions.

Problem
We will learn how to determine how the DualShock 4 is oriented and how to
interpret the acceleration values in more detail. For this problem, we will calculate
the magnitude of the acceleration from the DualShock 4. You will read from
ds4rd.exe, but this time you will read the inputs over and over inside a "while"
loop. Your code should be written in a modular fashion and include 3 or more of
your own functions.

When the DualShock 4 is not moving, your program should output a line saying
which side of the DualShock 4 is facing up. Consider using the magnitude of the
acceleration (-a) for movement detection. You will need a tolerance value for this-
--experiment to find one that seems reasonable. You will need to use the
gyroscope values (-g) to determine the orientation. Again, you may want a
separate tolerance value. (see development tips below about the close to
function and tolerance values)

For instance, when lying flat and still on the table with buttons up, it should output
TOP". Flipping the DualShock 4 over, when still, it should output "BOTTOM.
When setting the left side of the DualShock 4 (i.e. side with the arrow buttons)
down and the right side up, your program should output "LEFT". When flipped
(i.e. side with the shape buttons down), it should output "RIGHT" When the
LED light bar is pointed up at the ceiling, output "FRONT and similarly when
the LED light bar is down to the floor it should read "BACK."


Sagot :

Your presence in our community is highly appreciated. Keep sharing your insights and solutions. Together, we can build a rich and valuable knowledge resource for everyone. IDNLearn.com is your reliable source for accurate answers. Thank you for visiting, and we hope to assist you again.