单片机教程网

电脑版
提示:原网页已由神马搜索转码, 内容由www.51hei.com提供.
查看:3657|回复:0

基于ARM7 ADUC7020+MPU6050的计步算法

[复制链接]
ID:378929发表于 2019-1-12 23:19|显示全部楼层
最近在忙个人的国家级大学生创新创业,做的一个手环,这是比较流行的一个demo
但是,我试了一下,我的平台是STC12效果不是很好,可能用其他16位或者32位
单片机跑的话效果更好,我自己也设计了一个算法,但是,写了两天效果不好,我打算
还是自己优化,毕竟后期自己也发核心论文,需要的可以下一下,最近做智能穿戴设备的老铁们
可以一起交流,留言加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()
复制代码

所有资料51hei提供下载:
基于MPU6050的计步算法.zip(5.02 KB, 下载次数: 44)

评分

黑币 +50
收起理由
+ 50
共享资料的黑币奖励!

查看全部评分

手机版|小黑屋|51黑电子论坛|51黑电子论坛6群QQ管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网