Home › Forums › Forums › Technical Support for BerryIMU › ACCX and ACCY stuck at 45
- This topic has 1 reply, 2 voices, and was last updated 7 years, 12 months ago by Mark Williams.
- June 5, 2015 at 6:53 am #4113flynnboyoParticipant
I am using the python berry imu code and my ACCX and Y never move. I am building a turret and need the compass value (heading?) and the angle the gun is pointing eg up, straight, down..
Heading seems to change more when I rotate the turret up and down instead of side to side which seems strange. I have the unit mounted with the electronics facing downwards (skull side up) and longwise parallel to where a gun on the turret would be. I noticed there is code depending on which way you mount the unit but not where does it say which way is up. I am guessing skull up is regular mounting position.
Thanks for your help. I would not ask unless I had exhausted all documentation. I am using the unit with a Pi 2. I think I am using python 2.6 or 2.7.
CameronJune 6, 2015 at 1:29 pm #4117Mark WilliamsKeymaster
You have the BerryIMU upside down, so you would use this piece of code for the accelerometer
#If IMU is upside down # #if AccXangle >180: # AccXangle -= 360.0 #AccYangle-=90 #if (AccYangle >180): # AccYangle -= 360.0
Regarding the heading. Does it seam to work when the BerryIMU is level? The current python code does not include tilt compensation.
This is on our ‘to do’ list to add to the code
Mark --OzzMaker.com --
- You must be logged in to reply to this topic.