找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 4238|回復(fù): 0
收起左側(cè)

基于ARM7 ADUC7020+MPU6050的計步算法

[復(fù)制鏈接]
ID:378929 發(fā)表于 2019-1-12 23:19 | 顯示全部樓層 |閱讀模式
最近在忙個人的國家級大學(xué)生創(chuàng)新創(chuàng)業(yè),做的一個手環(huán),這是比較流行的一個demo
但是,我試了一下,我的平臺是STC12效果不是很好,可能用其他16位或者32位
單片機跑的話效果更好,我自己也設(shè)計了一個算法,但是,寫了兩天效果不好,我打算
還是自己優(yōu)化,畢竟后期自己也發(fā)核心論文,需要的可以下一下,最近做智能穿戴設(shè)備的老鐵們
可以一起交流,留言加QQ

單片機源程序如下:
  1. /*********************************************************************

  2. Author        : J Scarlett

  3. Date          : Nov 2006

  4. Files          : main.c, display.c, ped.c

  5. Hardware      : ADuC7020

  6. Description   : Implements a simple pedometer based on application
  7.                                          note AN-602
  8.                
  9. *********************************************************************/
  10. #include <ioaduc7020.h>

  11. //        Function Prototype with required function attribute.
  12. extern void Monitor_Function(void);
  13. extern void Display_Init(void);


  14. //*********************************************************************
  15. // Main Function for ADuC7020 Pedometer
  16. //                        essentially performs startup functions
  17. //*********************************************************************
  18. int main (void)
  19. {

  20.         POWKEY1 = 0x01;
  21.         POWCON = 0x06;                                                // set to 653kHz core clock
  22.         POWKEY2 = 0xF4;
  23.         REFCON = 0x2;                                                // use external reference
  24.                                                                                 //        (connected to Vdd)
  25. //*********************************************************************
  26. //        Initialize Peripherals
  27. //*********************************************************************
  28. // GPIO Configuration
  29.         GP4DAT = 0x04000000;                                // P4.2 configured as an output.
  30.                                                         //         LED is turned on        
  31.         GP0CON = 0x00000000;                                 //
  32.         GP0DAT = 0xE0000000;                                // 0.7, 0.6, and 0.5 are outputs
  33.                                                         // 0.7 = E, 0.5 = R/W*, 0.6 = RS
  34.         GP1DAT = 0xFF000000;                                // All P1 pins are outputs

  35.         ADCCON = 0x20;                                                // Turn ADC on but do not enable

  36.         Display_Init();                                                // found in file "display.c"
  37.         Monitor_Function();                                        // found in file "ped.c"
  38. //*********************************************************************
  39. // Main Loop
  40. //*********************************************************************
  41.         while(1)
  42.         {
  43.         }
  44. } // main()
復(fù)制代碼

所有資料51hei提供下載:
基于MPU6050的計步算法.zip (5.02 KB, 下載次數(shù): 44)

評分

參與人數(shù) 1黑幣 +50 收起 理由
admin + 50 共享資料的黑幣獎勵!

查看全部評分

回復(fù)

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

手機版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機教程網(wǎng)

快速回復(fù) 返回頂部 返回列表