ACCX and ACCY stuck at 45

Home Forums Forums Technical Support for BerryIMU ACCX and ACCY stuck at 45

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #4113
    flynnboyo
    Participant

    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.

    THanks Again,
    Cameron

    #4117
    Mark Williams
    Keymaster

    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 --

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Blip, blop, bloop...