element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
MusicTech
  • Challenges & Projects
  • Design Challenges
  • MusicTech
  • More
  • Cancel
MusicTech
Blog Music Tech Challenge - Motion tune 韻動 - Post 3.DataCollect 運動資料收集
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: momososo
  • Date Created: 9 Feb 2016 2:39 AM Date Created
  • Views 520 views
  • Likes 1 like
  • Comments 1 comment
  • musictech
  • motion_tune
Related
Recommended

Music Tech Challenge - Motion tune 韻動 - Post 3.DataCollect 運動資料收集

momososo
momososo
9 Feb 2016

To see all my post about this challenge

新年快樂

過年期間比較空閒,補一下進度。

買了幾塊加速度感測器,先選MPU6050來玩,搭配Nucleo32-F031K6。

接線圖如下,Eagle還不熟,只好先用Fritzing畫。

image

實際接出來長這樣,配線顏色特別符合上圖。

image

MPU6050是使用IIC通訊,這部分前幾個禮拜才剛學著用,所以不太熟。還好mbed上有前人完成好的範例可以參考,

image

Import Baser Kandehir 建立的I2C_MPU6050 ,修改成Nucleo32-F031K6腳位後測試結果是OK的。

image

確定了這個線路是可行的,接下來就是修改程式,依範例修改來得到我要的值。

目前的while loop裡的碼

    while(1) 
    {
     
     /* Uncomment below if you want to see accel and gyro data */
        
        pc.printf(" _____________________________________________________________  \r\n");
        pc.printf("| Accelerometer(g) | ax=%.3f | ay=%.3f | az=%.3f                \r\n",ax,ay,az);
        pc.printf("| Gyroscope(deg/s) | gx=%.3f | gy=%.3f | gz=%.3f                \r\n",gx,gy,gz);
        pc.printf("|_____________________________________________________________  \r\n\r\n");
        
        wait(2.5);
                
        filter.attach(&compFilter, 0.005);    // Call the complementaryFilter func. every 5 ms (200 Hz sampling period)
        
        pc.printf(" _______________\r\n");
        pc.printf("| Pitch: %.3f   \r\n",pitchAngle);
        pc.printf("| Roll:  %.3f   \r\n",rollAngle);
        pc.printf("|_______________\r\n\r\n");
        
        wait(1);
     
    }

目前的想法是先試試提高取樣頻率,輸出值後先用excel計算過,等套件來時再測試聲調。

除了MPU6050模組買了5塊外,我還買了MMA7455跟ADXL345各一塊,目前會先全部使用MPU6050模組。

  • Sign in to reply
  • clem57
    clem57 over 10 years ago

    momososo

    Very good post. Looking forward to next one. Happy Year of the Monkey to you as well.

    Clem

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube