#include "HardwareInfo.c"
#include "JMLib.c"
#include <GetRightButton.h>
#include <SetInBeep.h>
#include <SetAHRS.h>
#include <GetAHRS.h>
#include <SetDisplayVarBW.h>

int main(void)
{
    M2RCU_Init();
    int Roll = 0;
    int Pitch = 0;
    int Yaw = 0;
    int ButR = 0;
    while (1)
    {
        ButR = GetRightButton();
        if ( ButR==1 )
        {
            SetInBeep(ON);
            //校正一次水平姿态方位
            SetAHRS(_P1_, 1);
        }
        SetInBeep(OFF);
        Roll = GetAHRS(_P1_, 1, 0);
        Pitch = GetAHRS(_P1_, 2, 0);
        Yaw = GetAHRS(_P1_, 3, 0);
        SetDisplayVarBW(1, Roll);
        SetDisplayVarBW(2, Pitch);
        SetDisplayVarBW(3, Yaw);
    }
    while(1);
}

