bubu
Junior Member
Posts: 17
|
Post by bubu on Jul 15, 2014 21:51:40 GMT -8
I am currently experimenting with the get_accel command and noticed two things I do not understand. For my programm (simple breakout clone) I only need to deal with the x value, so I did not look further into y or z.
The book says the return values are scaled and 1g would be 256 as a return value.
First thing I do not understand: When I tilt my gameduino sideways 90 degrees, x gets to a maximum of about 180. I thought, turning it 90 degrees would be enough for 1g to work on the x axis of the device. I expected 256 here, not 180. Turning the device further than 90 degrees reduces the x value again (as expected by me).
Second thing I do not understand: Holding it without turning, while being powered by usb cable, returns 0 for x, just as expected. When I remove the usb cable and power the device by connecting a 9V battery, x returns 100 instead of 0.
Can somebody reproduce this or ist it some problem with my device?
By the way, there seems to be a typo in the book on page 130: void get_accel(int &x, int &y, int &y); should read z in the end, I suppose.
|
|