极客工坊

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 10837|回复: 0

mpu6050 dmp读出的角度为啥没有变化

[复制链接]
发表于 2015-2-24 00:48:21 | 显示全部楼层 |阅读模式
液晶屏显示读书一直是-533 为啥呢

[pre lang="51c语言" line="1"]while(1)
{
        i=getFIFOCount();//读取FIFO计数
        i2cread(0x3A,&zd);        //读取中断状态
        if((zd & 0x10)||i==1024)        //判断FIFO是否溢出
        {
            writeBit(0x6A,2,1);        //复位 FIFO
        }
        else if (zd & 0x02)
        {
            while(i<42) i=getFIFOCount();
                readdmp(dmpdatas);        //读取FIFO数据
                getquaternion();
                getyawpitchroll();
                tt=        yprf[1]%1000-533;
                if(tt<0) yprf[1]=tt*(-1);       
                  q=yprf[1]/1000;
                 b=yprf[1]/100%10;
                 s=yprf[1]%100/10;
                 g=yprf[1]%10;
                                           write_com(0x80);
                 if(tt<0)
                    write_data('-');
                        else
                                         write_data('+');
                          write_com(0x81);
                write_data(table[q]);
                          write_com(0x82);
                write_data(table);
                       write_com(0x83);
                write_data(table);
                        write_com(0x84);       
                write_data(table[g]);[/code]
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|联系我们|极客工坊

GMT+8, 2026-6-10 14:25 , Processed in 0.049929 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表