最近在忙個人的國家級大學生創新創業,做的一個手環,這是比較流行的一個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
|