标题:
基于ARM7 ADUC7020+MPU6050的计步算法
[打印本页]
作者:
MrHuan991
时间:
2019-1-12 23:19
标题:
基于ARM7 ADUC7020+MPU6050的计步算法
最近在忙个人的国家级大学生创新创业,做的一个手环,这是比较流行的一个demo
但是,我试了一下,我的平台是STC12效果不是很好,可能用其他16位或者32位
单片机跑的话效果更好,我自己也设计了一个算法,但是,写了两天效果不好,我打算
还是自己优化,毕竟后期自己也发核心论文,需要的可以下一下,最近做智能穿戴设备的老铁们
可以一起交流,留言加QQ
单片机源程序如下:
/*********************************************************************
Author : J Scarlett
Date : Nov 2006
Files : main.c, display.c, ped.c
Hardware : ADuC7020
Description : Implements a simple pedometer based on application
note AN-602
*********************************************************************/
#include <ioaduc7020.h>
// Function Prototype with required function attribute.
extern void Monitor_Function(void);
extern void Display_Init(void);
//*********************************************************************
// Main Function for ADuC7020 Pedometer
// essentially performs startup functions
//*********************************************************************
int main (void)
{
POWKEY1 = 0x01;
POWCON = 0x06; // set to 653kHz core clock
POWKEY2 = 0xF4;
REFCON = 0x2; // use external reference
// (connected to Vdd)
//*********************************************************************
// Initialize Peripherals
//*********************************************************************
// GPIO Configuration
GP4DAT = 0x04000000; // P4.2 configured as an output.
// LED is turned on
GP0CON = 0x00000000; //
GP0DAT = 0xE0000000; // 0.7, 0.6, and 0.5 are outputs
// 0.7 = E, 0.5 = R/W*, 0.6 = RS
GP1DAT = 0xFF000000; // All P1 pins are outputs
ADCCON = 0x20; // Turn ADC on but do not enable
Display_Init(); // found in file "display.c"
Monitor_Function(); // found in file "ped.c"
//*********************************************************************
// Main Loop
//*********************************************************************
while(1)
{
}
} // main()
复制代码
所有资料51hei提供下载:
基于MPU6050的计步算法.zip
(5.02 KB, 下载次数: 44)
2019-1-12 23:19 上传
点击文件名下载附件
下载积分: 黑币 -5
欢迎光临 (http://www.51hei.com/bbs/)
Powered by Discuz! X3.1