اطلاعیه

Collapse
No announcement yet.

[آموزش] معرفی،راه اندازی و تست سنسورMPU6050 با AVR+کتابخانه+فیلم

Collapse
X
 
  • فیلتر
  • زمان
  • Show
Clear All
new posts

    #46
    پاسخ : معرفی،راه اندازی و تست سنسورMPU6050 با AVR+کتابخانه+فیلم

    با سلام خدمت دوستان عزیز
    من یک الگوریتم پیدا کردم برای تلفیق داده های سنسورهای ژیروسکوپ و شتابسنج که بنظر میاد جدیدترین الگوریتمی باشه که در این باره از اون استفاده میکنن و کاملا هم open surce میباشد
    لینک دانلودشو قرار میدم که دوستان ازش استفاده بکنن البته این الگوریتم به زبان c نوشته شده
    تنها مشکلی خودم باهاش دارم این هستش که نمیدونم چجوری باید از این الگوریتم خروجی بگیرم :angry:
    https://www.mediafire.com/?bcbk4oecmiike3b
    این هم از فیلم استفاده از این الگوریتم برای کنترل یک دوربین
    https://www.youtube.com/watch?v=7GVXqNLLH7Q

    دیدگاه


      #47
      پاسخ : معرفی،راه اندازی و تست سنسورMPU6050 با AVR+کتابخانه+فیلم

      نوشته اصلی توسط pcsen
      سلام
      اگه امکانش هست راجب راه اندازی قسمت dmp هم راهنمایی بکنید

      شما میتونید از این کتابخونه ای که اینجا اپلود کردم استفاده کنید
      http://www.mediafire.com/download/3803c73xj769dhd/New+folder+%283%29.rar

      دیدگاه


        #48
        پاسخ : معرفی،راه اندازی و تست سنسورMPU6050 با AVR+کتابخانه+فیلم

        سلام من میخوام پروزه شما را اجرا کنم ولی وقتی توی cv build میکنم ارور اسمبلی واسه i2c میاد!!!!دلیلش چیه و اینکه اگه بخوام پروزه جدید تعریف کنم لازمه توی ویزارد i2c را تعریف کنم؟؟؟
        3-شما توی برنامه ای که نوشته بودید متغیر تعریف نکرده بودید!چجوری هست ؟؟؟؟؟!!!!!
        ممنون میشم راهنمایی کنید......
        با سپاس

        دیدگاه


          #49
          پاسخ : معرفی،راه اندازی و تست سنسورMPU6050 با AVR+کتابخانه+فیلم

          سلام لطفا یکی از شما که از این کتابخانه تونسته جواب بگیره میشه پله به پله مراحل کارشو بزاره؟
          من یه برنامه جدید باز میکنم...i2c را روی 2 تا پایه از یه پورت میزارم.... و فایل کتابخانه را include میکنم .....تابع init مربوط به i2c را مینویسم...ولی ارور میده :the declared function but never defined
          این ارور را برای تمام توابعی که مینویسم میده....دلیلش چیه میشه راهنمایی کنید؟
          واقعا کارم گیره :sad: :angry:

          دیدگاه


            #50
            پاسخ : معرفی،راه اندازی و تست سنسورMPU6050 با AVR+کتابخانه+فیلم

            با سلام من میخوام مقدار تغییر جهت یک بازو را اندازه بگیرم مثلا یک چتر را تصور کنید که وقتی بازو بسته میشه زاویه بازوها تغییر میکنه از این سنسور میتونم استفاده کنم؟درضمن اگر بخوام مسافت طی شده را هم اندازه بگیرم میشه از این سنسور استفاده کرد؟

            دیدگاه


              #51
              پاسخ : معرفی،راه اندازی و تست سنسورMPU6050 با AVR+کتابخانه+فیلم

              نوشته اصلی توسط S_Ahmad
              dmp مسئله ی پیچیده ای هست ولی سخت نیست!
              برای راه اندازی dmp تمامی قسمت های سنسور اعم از FIFO , interrupt و ... راه اندازی بشه! که هر کدومشون یه داستانی برای خودشون دارن.
              لذا نمیشه در قالب یک راهنمایی یا یک فیلم آموزش داد.
              به نظر من حداقل یک کتاب می خواد.

              ولی به جای این همه زحمت که باید یک نفر متحمل بشه، بهتره کتاب اصلی که همون دیتاشیت هست مطالعه بکنید.
              ______________________

              نکته ای که وجود داره با این سبکی که بنده ارائه دادم نیاز به dmp هست ، چون AVR توانایی انجام محاسبات لازمه رو نداره.
              ولی اگر شما این کتابخانه رو با همین سبک توسط ARM استفاده بکنید ،یعنی فقط اطلاعات خام و اساسی، همچنین پارامترهای مهم رو دریافت کنید سپس اونها رو در فیلترهای ذکر شده در فیلم مشارکت بدید می توانید خروجی های مختلفی رو داشته باشید و به حداکثر پایداری و دقت برسید. علت اینکه می گم ARM بدون dmp ، بخاطر اینکه همون ترکیب اطلاعات رو می شه با ARM با سرعت بالا انجام داد.
              ______________________

              ولی با این حال:
              متاسفانه شرکت Ivensense نمی خواهد که الگوریتم DMP در MPU6050 فاش شود، حتی رجیستر های اون رو در RegisterMap نشون نداده و بنده اطلاعات تکمیلی درباره ی نام رجیسترها و آدرس های اون ها رو از منابع مختلف جمع کردم و لیست رجیسترها در کتابخانه رو تکمیل کردم.

              کلاً کار DMP این هست که دیتای جایرو و شتاب رو با هم ترکیب بکنه، تا تاثیر خطای ذاتی هر سنسور رو به حداقل برسونه!

              چون درخواست راهنمایی کرده بودید باید گفت که بر اساس کنجکاوی هایی که من انجام دادم، بررسی کردم و فهمیدم که نتایج و اطلاعات خروجی DMP ، بسیار بسیار به خروجی یک فیلتر کامپلی منتاری شباهت داره!
              لذا اساساً اول باید این فیلتر رو یاد بگیرید.
              ______________________

              شما شروع کنید سوالی بود در خدمتم.
              سلام آقا سید
              دمت گرم بابا هرجا میرم تو کامنتا هستی :applause:
              ببخشید یه سوال
              من دارم رباتی میسازم که تو تمام جهات حرکت کنه
              برا همین نیاز به دونستن راستای ربات (heading) بود که با کلی درد سر کامپس hmc5883l رو راه اندازی کردم
              ولی وقتی کنار مقناطیس موتور دی سی قرار میگیره کاملا به هم میریزه :cry:
              حالا با کلی تحقیق فهمیدم که باید از ترکیب شتاب سنج و جایرو و فیلتر کالمن استفاده کنم(فیلم mpu6050 هم که گذاشتین دیدم :job
              حالا سوالم اینه آیا واقعا به این روش میشه heading رو به دست اورد؟
              تو سایت یه mpu5060 با فیلتر کالمن هم هست . اگه از اون استفاده کنیم میشه از dmp صرف نظر کرد؟
              ممنون میشم اگه راهنمایی کنین

              دیدگاه


                #52
                پاسخ : معرفی،راه اندازی و تست سنسورMPU6050 با AVR+کتابخانه+فیلم

                سلام من اون مازول رو راه انداختم با فیلتر کالمن .....خروجی صافی داره....راه اندازی dmp دردسر زیادی داره و دقت کن سرعت زیادی هم نداره.....

                دیدگاه


                  #53
                  پاسخ : معرفی،راه اندازی و تست سنسورMPU6050 با AVR+کتابخانه+فیلم

                  سلام
                  من میخوام با lpc1768 این ماژول رو راه اندازی کنم.
                  من توابع i2c رو نمیدونم چین توی keil میشه راهنمایی کنید؟

                  دیدگاه


                    #54
                    پاسخ : معرفی،راه اندازی و تست سنسورMPU6050 با AVR+کتابخانه+فیلم

                    نوشته اصلی توسط hero.seller17
                    سلام من اون مازول رو راه انداختم با فیلتر کالمن .....خروجی صافی داره....راه اندازی dmp دردسر زیادی داره و دقت کن سرعت زیادی هم نداره.....
                    سلام دوست عزیز
                    امکان داره یک مقدار بیشتر توضیح بدید

                    دیدگاه


                      #55
                      پاسخ : معرفی،راه اندازی و تست سنسورMPU6050 با AVR+کتابخانه+فیلم

                      آیا این سنسور، سقوط آزاد هم داره؟
                      تو بعضی کتابخونه ها و هدر ها نام رجستر سقوط آزاد و توابع مربوط به اون اومده اما تو دیتاشیت اسمی ازش نبرده! :eek:
                      جریان چیه؟
                      در انتظار تو چشمم سپید گشت و غمی نیست
                      اگر قبول تو افتد، فدای چشم سیاهت

                      http://upload7.ir/images/83524254953910725183.gif

                      دیدگاه


                        #56
                        پاسخ : معرفی،راه اندازی و تست سنسورMPU6050 با AVR+کتابخانه+فیلم

                        یک سوال عجیب ..من توی فرستادن دیتا به کامپیوتر دچار اشکال شدم ممکنه کسی از دوستان ایراد کار رو بگه؟ من این کد رو فرضا میزنم توی codevision
                        کد:
                        printf("Temp Val is: %.1f degree Celsius \n\r",Temp_Val);
                        ولی توی ترمینال اینو دریافت میکنم!
                        کد:
                        Temp Val is: 1f degree Celsius
                        چرا؟لطفا جوابمو بدید

                        دیدگاه


                          #57
                          پاسخ : معرفی،راه اندازی و تست سنسورMPU6050 با AVR+کتابخانه+فیلم

                          نوشته اصلی توسط hero.seller17
                          یک سوال عجیب ..من توی فرستادن دیتا به کامپیوتر دچار اشکال شدم ممکنه کسی از دوستان ایراد کار رو بگه؟ من این کد رو فرضا میزنم توی codevision
                          کد:
                          printf("Temp Val is: %.1f degree Celsius \n\r",Temp_Val);
                          ولی توی ترمینال اینو دریافت میکنم!
                          کد:
                          Temp Val is: 1f degree Celsius
                          چرا؟لطفا جوابمو بدید
                          اینو قبلا جناب موسوی فرموده بودن. پاسخ شما رو قرمز کردم:

                          نوشته اصلی توسط S_Ahmad
                          بعضی از دوستان پیغام می دهند و ضمن تشکر ، مشکلات خود را بیان می کنند.
                          ببینید در فیلم امکان آموزش USART و کتابخانه نویسی نیست و اینها جز مباحث حاشیه ای هست!
                          ولی مهم ترین نکته این هست که مختصراً اشاره ای می کنم:

                          اگر پروژه ای جدید تعریف کرده اید(توجه به پیکربندی صحیح USART و I2C بکنید)، برای اضافه کردن کتابخانه کافی است مراحل زیر را دنبال کنید:
                          1- فایل های کتابخانه را در محلی مناسب قرار دهید(مثلاً مثل فایلی که دانلود کردید ، درون مسیر اصلی پروژه در یک پوشه)
                          2- در پروژه اصلی در ابتدای برنامه MPU6050.h را include کنید.
                          3-اگر کامپایلر شما کدویژن هست، از منوی Project گزینه ی Configure باز کنید.در زبانه ی Input File فایل MPU6050.c را Add کنید.
                          4- برنامه را کامپایل کنید.
                          _________________
                          گاهی اوقات در تنظیمات نرم افزار کدویژن نکاتی را رعایت نمی کنید و بعد در هنگام نمایش اطلاعات در نرم افزار هایپرترمینال هیچ چیزی نمی بینید.
                          این بخاطر این هست که تنظیمات کامپایلر در تولید کد رو رعایت نکردید.
                          جنس متغیرهایی که در سریال منتقل می شوند، Float است، لذا باید در پنجره ی Configure (که از منوی Project باز میشه) زبانه ی C Compiler رو انتخاب و سپس زبانه ی Code Generation رو انتخاب و برای قسمت (s)printf Fearures گزینه ی float,width,precision رو انتخاب کنید.سپس Ok بزنید.
                          _________________
                          نکته ای که در فیلم از قلم افتاد، و به نوعی بد گفته شد و شاید موجب برداشت اشتباه شود:
                          این هست که رجیستر RA_SMPLRT_DIV مقداری بین 0 تا 255 می تونه داشته باشه.
                          ولی در فیلم به نوعی بهترین بازه ی SampleRateDiv بین 0 تا 7 رو اشاره کردیم، لذا این رو بخاطر داشته باشید که SampleRateDivمی تونه مقداری بین 0 تا 255 داشته باشه ولی به خاطر این نوع راه اندازی و طبق تجربه ی بنده این بهترین محدوده برای SampleRateDiv هست.

                          با تشکر از همه! :bye
                          در انتظار تو چشمم سپید گشت و غمی نیست
                          اگر قبول تو افتد، فدای چشم سیاهت

                          http://upload7.ir/images/83524254953910725183.gif

                          دیدگاه


                            #58
                            پاسخ : معرفی،راه اندازی و تست سنسورMPU6050 با AVR+کتابخانه+فیلم

                            سلام دوستان عزیز

                            راستش من mpu6050 رو میخوام با lpc1768 راه بندازم.چجور میتونم این کتابخونه رو توی محیط keil بدون ارور بیارم؟چون خیلی ارور میده.
                            این توی قسمت build output میاد.
                            دمتون گرم خیلی واجبه اگه راهنمایی دارید ممنون می شم.

                            کد:
                            Build target 'Target 1'
                            compiling gyro.c...
                            gyro.c: Warning: C3912W: Option 'device' is deprecated.
                            RA_MPU6050.h(7): warning: #161-D: unrecognized #pragma
                             #pragma used+
                            RA_MPU6050.h(151): warning: #161-D: unrecognized #pragma
                             #pragma used-
                            MPU6050_PR.h(6): warning: #161-D: unrecognized #pragma
                             #pragma used+
                            MPU6050_PR.h(57): error: #14-D: extra text after expected end of preprocessing directive
                              #if GFS_SEL == GYRO_FullScale_Range_250
                            MPU6050_PR.h(60): error: #14-D: extra text after expected end of preprocessing directive
                              #if GFS_SEL == GYRO_FullScale_Range_500
                            MPU6050_PR.h(62): error: #14-D: extra text after expected end of preprocessing directive
                              #elif GFS_SEL == GYRO_FullScale_Range_1000
                            MPU6050_PR.h(64): error: #14-D: extra text after expected end of preprocessing directive
                              #elif GFS_SEL == GYRO_FullScale_Range_2000
                            MPU6050_PR.h(83): error: #14-D: extra text after expected end of preprocessing directive
                             #if AFS_SEL == ACCEL_FullScale_Range_2g
                            MPU6050_PR.h(85): error: #14-D: extra text after expected end of preprocessing directive
                              #elif AFS_SEL == ACCEL_FullScale_Range_4g
                            MPU6050_PR.h(87): error: #14-D: extra text after expected end of preprocessing directive
                              #elif AFS_SEL == ACCEL_FullScale_Range_8g
                            MPU6050_PR.h(89): error: #14-D: extra text after expected end of preprocessing directive
                              #elif AFS_SEL == ACCEL_FullScale_Range_16g
                            MPU6050_PR.h(133): warning: #161-D: unrecognized #pragma
                             #pragma used-
                            mpu6050.h(20): warning: #161-D: unrecognized #pragma
                             #pragma used+
                            mpu6050.h(60): warning: #1295-D: Deprecated declaration MPU6050_Test_I2C - give arg types
                             extern unsigned char MPU6050_Test_I2C();
                            mpu6050.h(62): warning: #1295-D: Deprecated declaration MPU6050_Reset - give arg types
                             extern void MPU6050_Reset();
                            mpu6050.h(63): warning: #1295-D: Deprecated declaration MPU6050_Init - give arg types
                             extern void MPU6050_Init();
                            mpu6050.h(64): warning: #1295-D: Deprecated declaration Get_Accel_Offset - give arg types
                             extern void Get_Accel_Offset();
                            mpu6050.h(65): warning: #1295-D: Deprecated declaration Get_Accel_Val - give arg types
                             extern void Get_Accel_Val();
                            mpu6050.h(66): warning: #1295-D: Deprecated declaration Get_AvrgAccel_Val - give arg types
                             extern void Get_AvrgAccel_Val();
                            mpu6050.h(67): warning: #1295-D: Deprecated declaration Get_Accel_Angles - give arg types
                             extern void Get_Accel_Angles();
                            mpu6050.h(68): warning: #1295-D: Deprecated declaration Get_Gyro_Offset - give arg types
                             extern void Get_Gyro_Offset();
                            mpu6050.h(69): warning: #1295-D: Deprecated declaration Get_Gyro_Val - give arg types
                             extern void Get_Gyro_Val();
                            mpu6050.h(70): warning: #1295-D: Deprecated declaration Get_AvrgGyro_Val - give arg types
                             extern void Get_AvrgGyro_Val();
                            mpu6050.h(71): warning: #1295-D: Deprecated declaration Get_Temp_Val - give arg types
                             extern void Get_Temp_Val();
                            mpu6050.h(73): warning: #161-D: unrecognized #pragma
                             #pragma used-
                            mpu6050.c(31): warning: #161-D: unrecognized #pragma
                             #pragma warn-
                            mpu6050.c(54): error: #513: a value of type "uint8_t *" cannot be assigned to an entity of type "unsigned char"
                             Data=txsetup.rx_data; 
                            mpu6050.c(124): error: #18: expected a ")"
                               write_i2c(MPU6050_ADDRESS, RA_GYRO_CONFIG, (((XG_ST|YG_ST|ZG_ST)<<5)|(GFS_SEL)));
                            mpu6050.c(126): error: #18: expected a ")"
                               write_i2c(MPU6050_ADDRESS, RA_ACCEL_CONFIG, ((XA_ST|YA_ST|ZA_ST)<<5)|AFS_SEL);
                            mpu6050.c(251): error: #20: identifier "ACCEL_Sensitivity" is undefined
                               Accel_In_g[X] = Accel_In_g[X] / ACCEL_Sensitivity;
                            mpu6050.c(295): error: #20: identifier "ACCEL_Sensitivity" is undefined
                              Accel_In_g[X] = Accel_In_g[X] / ACCEL_Sensitivity; // g/LSB
                            mpu6050.c(377): error: #20: identifier "GYRO_Sensitivity" is undefined
                               GyroRate_Val[X] = GyroRate_Val[X] / GYRO_Sensitivity;
                            mpu6050.c(425): error: #20: identifier "GYRO_Sensitivity" is undefined
                              GyroRate_Val[X] = GyroRate_Val[X] / GYRO_Sensitivity;  // (º/s)/LSB
                            mpu6050.c(440): warning: #161-D: unrecognized #pragma
                             #pragma warn+
                            gyro.c(134): error: #268: declaration may not appear after executable statement in block
                                I2C_M_SETUP_Type txsetup;
                            gyro.c(136): error: #268: declaration may not appear after executable statement in block
                             I2C_M_SETUP_Type rxsetup;
                            gyro.c(134): warning: #177-D: variable "txsetup" was declared but never referenced
                                I2C_M_SETUP_Type txsetup;
                            gyro.c(136): error: #67: expected a "}"
                             I2C_M_SETUP_Type rxsetup;
                            gyro.c(137): error: #79: expected a type specifier
                             UART_DeInit(LPC_UART0);
                            gyro.c(137): warning: #77-D: this declaration has no storage class or type specifier
                             UART_DeInit(LPC_UART0);
                            gyro.c(137): error: #147: declaration is incompatible with "void UART_DeInit(LPC_UART_TypeDef *)" (declared at line 585 of "lpc17xx_uart.h")
                             UART_DeInit(LPC_UART0);
                            gyro.c(138): error: #79: expected a type specifier
                             UART_ConfigStructInit(LPC_UART0);
                            gyro.c(138): warning: #77-D: this declaration has no storage class or type specifier
                             UART_ConfigStructInit(LPC_UART0);
                            gyro.c(138): error: #147: declaration is incompatible with "void UART_ConfigStructInit(UART_CFG_Type *)" (declared at line 586 of "lpc17xx_uart.h")
                             UART_ConfigStructInit(LPC_UART0);
                            gyro.c(146): error: #40: expected an identifier
                               NVIC_SetPriority(I2C0_IRQn,0);     /* Default priority group 0, can be 0(highest) - 31(lowest) */
                            gyro.c(146): warning: #77-D: this declaration has no storage class or type specifier
                               NVIC_SetPriority(I2C0_IRQn,0);     /* Default priority group 0, can be 0(highest) - 31(lowest) */
                            gyro.c(146): error: #92: identifier-list parameters may only be used in a function definition
                               NVIC_SetPriority(I2C0_IRQn,0);     /* Default priority group 0, can be 0(highest) - 31(lowest) */
                            gyro.c(146): error: #147: declaration is incompatible with "void NVIC_SetPriority(IRQn_Type, uint32_t)" (declared at line 996 of "C:\Keil_v5\ARM\Inc\NXP\LPC17xx\core_cm3.h")
                               NVIC_SetPriority(I2C0_IRQn,0);     /* Default priority group 0, can be 0(highest) - 31(lowest) */
                            gyro.c(147): warning: #77-D: this declaration has no storage class or type specifier
                               NVIC_EnableIRQ(I2C0_IRQn);      /* Enable I2C0 Interrupt */
                            gyro.c(147): error: #92: identifier-list parameters may only be used in a function definition
                               NVIC_EnableIRQ(I2C0_IRQn);      /* Enable I2C0 Interrupt */
                            gyro.c(147): error: #147: declaration is incompatible with "void NVIC_EnableIRQ(IRQn_Type)" (declared at line 912 of "C:\Keil_v5\ARM\Inc\NXP\LPC17xx\core_cm3.h")
                               NVIC_EnableIRQ(I2C0_IRQn);      /* Enable I2C0 Interrupt */
                            gyro.c(149): error: #40: expected an identifier
                               NVIC_SetPriority(UART0_IRQn,0);     /* Default priority group 0, can be 0(highest) - 31(lowest) */
                            gyro.c(149): warning: #77-D: this declaration has no storage class or type specifier
                               NVIC_SetPriority(UART0_IRQn,0);     /* Default priority group 0, can be 0(highest) - 31(lowest) */
                            gyro.c(149): error: #92: identifier-list parameters may only be used in a function definition
                               NVIC_SetPriority(UART0_IRQn,0);     /* Default priority group 0, can be 0(highest) - 31(lowest) */
                            gyro.c(149): error: #147: declaration is incompatible with "void NVIC_SetPriority(IRQn_Type, uint32_t)" (declared at line 996 of "C:\Keil_v5\ARM\Inc\NXP\LPC17xx\core_cm3.h")
                               NVIC_SetPriority(UART0_IRQn,0);     /* Default priority group 0, can be 0(highest) - 31(lowest) */
                            gyro.c: 25 warnings, 30 errors
                            ".\Objects\gyro.axf" - 30 Error(s), 26 Warning(s).
                            Target not created.

                            دیدگاه


                              #59
                              پاسخ : معرفی،راه اندازی و تست سنسورMPU6050 با AVR+کتابخانه+فیلم

                              سلام دوستان عزیز

                              راستش من mpu6050 رو میخوام با lpc1768 راه بندازم.چجور میتونم این کتابخونه رو توی محیط keil بدون ارور بیارم؟چون خیلی ارور میده.
                              این توی قسمت build output میاد.
                              دمتون گرم خیلی واجبه اگه راهنمایی دارید ممنون می شم.
                              ببخشید قبلی مشکل داشت این build output برنامس:

                              کد:
                              Build target 'Target 1'
                              compiling gyro.c...
                              gyro.c: Warning: C3912W: Option 'device' is deprecated.
                              RA_MPU6050.h(7): warning: #161-D: unrecognized #pragma
                               #pragma used+
                              RA_MPU6050.h(151): warning: #161-D: unrecognized #pragma
                               #pragma used-
                              MPU6050_PR.h(6): warning: #161-D: unrecognized #pragma
                               #pragma used+
                              MPU6050_PR.h(57): error: #14-D: extra text after expected end of preprocessing directive
                               #if GFS_SEL == GYRO_FullScale_Range_250
                              MPU6050_PR.h(60): error: #14-D: extra text after expected end of preprocessing directive
                                #if GFS_SEL == GYRO_FullScale_Range_500
                              MPU6050_PR.h(62): error: #14-D: extra text after expected end of preprocessing directive
                                #elif GFS_SEL == GYRO_FullScale_Range_1000
                              MPU6050_PR.h(64): error: #14-D: extra text after expected end of preprocessing directive
                                #elif GFS_SEL == GYRO_FullScale_Range_2000
                              MPU6050_PR.h(83): error: #14-D: extra text after expected end of preprocessing directive
                               #if AFS_SEL == ACCEL_FullScale_Range_2g
                              MPU6050_PR.h(85): error: #14-D: extra text after expected end of preprocessing directive
                                #elif AFS_SEL == ACCEL_FullScale_Range_4g
                              MPU6050_PR.h(87): error: #14-D: extra text after expected end of preprocessing directive
                                #elif AFS_SEL == ACCEL_FullScale_Range_8g
                              MPU6050_PR.h(89): error: #14-D: extra text after expected end of preprocessing directive
                                #elif AFS_SEL == ACCEL_FullScale_Range_16g
                              MPU6050_PR.h(133): warning: #161-D: unrecognized #pragma
                               #pragma used-
                              mpu6050.h(20): warning: #161-D: unrecognized #pragma
                               #pragma used+
                              mpu6050.h(60): warning: #1295-D: Deprecated declaration MPU6050_Test_I2C - give arg types
                               extern unsigned char MPU6050_Test_I2C();
                              mpu6050.h(62): warning: #1295-D: Deprecated declaration MPU6050_Reset - give arg types
                               extern void MPU6050_Reset();
                              mpu6050.h(63): warning: #1295-D: Deprecated declaration MPU6050_Init - give arg types
                               extern void MPU6050_Init();
                              mpu6050.h(64): warning: #1295-D: Deprecated declaration Get_Accel_Offset - give arg types
                               extern void Get_Accel_Offset();
                              mpu6050.h(65): warning: #1295-D: Deprecated declaration Get_Accel_Val - give arg types
                               extern void Get_Accel_Val();
                              mpu6050.h(66): warning: #1295-D: Deprecated declaration Get_AvrgAccel_Val - give arg types
                               extern void Get_AvrgAccel_Val();
                              mpu6050.h(67): warning: #1295-D: Deprecated declaration Get_Accel_Angles - give arg types
                               extern void Get_Accel_Angles();
                              mpu6050.h(68): warning: #1295-D: Deprecated declaration Get_Gyro_Offset - give arg types
                               extern void Get_Gyro_Offset();
                              mpu6050.h(69): warning: #1295-D: Deprecated declaration Get_Gyro_Val - give arg types
                               extern void Get_Gyro_Val();
                              mpu6050.h(70): warning: #1295-D: Deprecated declaration Get_AvrgGyro_Val - give arg types
                               extern void Get_AvrgGyro_Val();
                              mpu6050.h(71): warning: #1295-D: Deprecated declaration Get_Temp_Val - give arg types
                               extern void Get_Temp_Val();
                              mpu6050.h(73): warning: #161-D: unrecognized #pragma
                               #pragma used-
                              mpu6050.c(31): warning: #161-D: unrecognized #pragma
                               #pragma warn-
                              mpu6050.c(54): error: #513: a value of type "uint8_t *" cannot be assigned to an entity of type "unsigned char"
                               Data=txsetup.rx_data; 
                              mpu6050.c(124): error: #18: expected a ")"
                                 write_i2c(MPU6050_ADDRESS, RA_GYRO_CONFIG, (((XG_ST|YG_ST|ZG_ST)<<5)|(GFS_SEL)));
                              mpu6050.c(126): error: #18: expected a ")"
                                 write_i2c(MPU6050_ADDRESS, RA_ACCEL_CONFIG, ((XA_ST|YA_ST|ZA_ST)<<5)|AFS_SEL);
                              mpu6050.c(251): error: #20: identifier "ACCEL_Sensitivity" is undefined
                                 Accel_In_g[X] = Accel_In_g[X] / ACCEL_Sensitivity;
                              mpu6050.c(295): error: #20: identifier "ACCEL_Sensitivity" is undefined
                                Accel_In_g[X] = Accel_In_g[X] / ACCEL_Sensitivity; // g/LSB
                              mpu6050.c(377): error: #20: identifier "GYRO_Sensitivity" is undefined
                                 GyroRate_Val[X] = GyroRate_Val[X] / GYRO_Sensitivity;
                              mpu6050.c(425): error: #20: identifier "GYRO_Sensitivity" is undefined
                                GyroRate_Val[X] = GyroRate_Val[X] / GYRO_Sensitivity;  // (º/s)/LSB
                              mpu6050.c(440): warning: #161-D: unrecognized #pragma
                               #pragma warn+
                              gyro.c(134): error: #268: declaration may not appear after executable statement in block
                                  I2C_M_SETUP_Type txsetup;
                              gyro.c(136): error: #268: declaration may not appear after executable statement in block
                               I2C_M_SETUP_Type rxsetup;
                              gyro.c(134): warning: #177-D: variable "txsetup" was declared but never referenced
                                  I2C_M_SETUP_Type txsetup;
                              gyro.c(136): error: #67: expected a "}"
                               I2C_M_SETUP_Type rxsetup;
                              gyro.c(137): error: #79: expected a type specifier
                               UART_DeInit(LPC_UART0);
                              gyro.c(137): warning: #77-D: this declaration has no storage class or type specifier
                               UART_DeInit(LPC_UART0);
                              gyro.c(137): error: #147: declaration is incompatible with "void UART_DeInit(LPC_UART_TypeDef *)" (declared at line 585 of "lpc17xx_uart.h")
                               UART_DeInit(LPC_UART0);
                              gyro.c(138): error: #79: expected a type specifier
                               UART_ConfigStructInit(LPC_UART0);
                              gyro.c(138): warning: #77-D: this declaration has no storage class or type specifier
                               UART_ConfigStructInit(LPC_UART0);
                              gyro.c(138): error: #147: declaration is incompatible with "void UART_ConfigStructInit(UART_CFG_Type *)" (declared at line 586 of "lpc17xx_uart.h")
                               UART_ConfigStructInit(LPC_UART0);
                              gyro.c(146): error: #40: expected an identifier
                                 NVIC_SetPriority(I2C0_IRQn,0);     /* Default priority group 0, can be 0(highest) - 31(lowest) */
                              gyro.c(146): warning: #77-D: this declaration has no storage class or type specifier
                                 NVIC_SetPriority(I2C0_IRQn,0);     /* Default priority group 0, can be 0(highest) - 31(lowest) */
                              gyro.c(146): error: #92: identifier-list parameters may only be used in a function definition
                                 NVIC_SetPriority(I2C0_IRQn,0);     /* Default priority group 0, can be 0(highest) - 31(lowest) */
                              gyro.c(146): error: #147: declaration is incompatible with "void NVIC_SetPriority(IRQn_Type, uint32_t)" (declared at line 996 of "C:\Keil_v5\ARM\Inc\NXP\LPC17xx\core_cm3.h")
                                 NVIC_SetPriority(I2C0_IRQn,0);     /* Default priority group 0, can be 0(highest) - 31(lowest) */
                              gyro.c(147): warning: #77-D: this declaration has no storage class or type specifier
                                 NVIC_EnableIRQ(I2C0_IRQn);      /* Enable I2C0 Interrupt */
                              gyro.c(147): error: #92: identifier-list parameters may only be used in a function definition
                                 NVIC_EnableIRQ(I2C0_IRQn);      /* Enable I2C0 Interrupt */
                              gyro.c(147): error: #147: declaration is incompatible with "void NVIC_EnableIRQ(IRQn_Type)" (declared at line 912 of "C:\Keil_v5\ARM\Inc\NXP\LPC17xx\core_cm3.h")
                                 NVIC_EnableIRQ(I2C0_IRQn);      /* Enable I2C0 Interrupt */
                              gyro.c(149): error: #40: expected an identifier
                                 NVIC_SetPriority(UART0_IRQn,0);     /* Default priority group 0, can be 0(highest) - 31(lowest) */
                              gyro.c(149): warning: #77-D: this declaration has no storage class or type specifier
                                 NVIC_SetPriority(UART0_IRQn,0);     /* Default priority group 0, can be 0(highest) - 31(lowest) */
                              gyro.c(149): error: #92: identifier-list parameters may only be used in a function definition
                                 NVIC_SetPriority(UART0_IRQn,0);     /* Default priority group 0, can be 0(highest) - 31(lowest) */
                              gyro.c(149): error: #147: declaration is incompatible with "void NVIC_SetPriority(IRQn_Type, uint32_t)" (declared at line 996 of "C:\Keil_v5\ARM\Inc\NXP\LPC17xx\core_cm3.h")
                                 NVIC_SetPriority(UART0_IRQn,0);     /* Default priority group 0, can be 0(highest) - 31(lowest) */
                              gyro.c: 25 warnings, 30 errors
                              ".\Objects\gyro.axf" - 30 Error(s), 26 Warning(s).
                              Target not created.

                              دیدگاه


                                #60
                                پاسخ : معرفی،راه اندازی و تست سنسورMPU6050 با AVR+کتابخانه+فیلم

                                با سلام و خسته نباشید خدمت همه دوستان، من میخواستم سرعت انتقال اطلاعات به کامپیوتر رو بالا ببرم... اما وقتی baud rate رو روی مقدار زیادتری نسبت به 9600 قرار میدم، اطلاعات نمایش داده شده توی نرم افزار ترمینال کدویژن بهم ریخته میشه... کسی میتونه راهنمایی کنه؟

                                دیدگاه

                                لطفا صبر کنید...
                                X