element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • 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
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • Product Groups
  • 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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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
RoadTests & Reviews
  • Products
  • More
RoadTests & Reviews
Blog MAX31889EVSYS and MAX32630FTHR RoadTest Review Part 1
  • Blog
  • RoadTest Forum
  • Documents
  • Events
  • RoadTests
  • Reviews
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • RoadTest
  • max32630fthr
  • bmi160
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Related
Recommended

MAX31889EVSYS and MAX32630FTHR RoadTest Review Part 1

raspberrypitechguy
raspberrypitechguy
27 Sep 2020

I am already done with the main part of the roadtest, at least what I was able to do, this is a series of blog posts to complement the RoadTest and to work the features of the Feather, the MAX32630FTHR.

 

This blog post is to test the BMI160 onboard the device.

 

TRIAL: BMI160.

 

I don't know who wrote the Mbed library. The printf function cannot print out integers and floats. Have yet to try with longs and doubles, but I'm assuming not.

 

Initially, the sample code provided "%f" for all values of the gyro/accelerometer.

 

Revising the code to this:

 

oss << "ACC xAxis = " << std::to_string(accData.xAxis.raw) << " : " << my_to_string(accData.xAxis.scaled) << static_cast<double>(accData.xAxis.scaled) << "\n\r"

        << "ACC yAxis = " << std::to_string(accData.yAxis.raw) << " : " <<  my_to_string(accData.yAxis.scaled) << "\n\r"
        << "ACC zAxis = " << std::to_string(accData.zAxis.raw) << " : " << my_to_string(accData.zAxis.scaled) << "\n\r"
        << "GYRO xAxis = " << std::to_string(gyroData.zAxis.raw) << " : " << my_to_string(gyroData.xAxis.scaled) << "\n\r"
        << "GYRO yAxis = " << std::to_string(gyroData.zAxis.raw) << " : " << my_to_string(gyroData.yAxis.scaled) << "\n\r"
        << "GYRO zAxis = " << std::to_string(gyroData.zAxis.raw) << " : " << my_to_string(gyroData.zAxis.scaled) << "\n\r"
        << "Sensor Time = " << std::to_string(sensorTime.seconds) << "\n\r"
        << "Sensor Temp = " << std::to_string(imuTemperature) << "\n\r";
        pc.write((void*)oss.str().c_str(), oss.str().size() + 1);
        wait_us(100000);

(of course, with the proper libraries and declarations...)

 

This yielded,

GYRO zAxis = 48 : 292

Sensor Time = %f

Sensor Temp = %f

ACC xAxis = -2127 : -25

ACC yAxis = 1961 : 23

ACC zAxis = 8714 : 106

GYRO xAxis = -13 : 134

GYRO yAxis = -13 : -103

GYRO zAxis = -13 : -79

Sensor Time = %f

Sensor Temp = %f

ACC xAxis = -1632 : -19

ACC yAxis = 480 : 5

ACC zAxis = 8369 : 102

GYRO xAxis = -22 : -103

GYRO yAxis = -22 : 329

GYRO zAxis = -22 : -134

Sensor Time = %f

Sensor Temp = %f

ACC xAxis = -1008 : -12

ACC yAxis = -576 : -7

ACC zAxis = 8895 : 108

GYRO xAxis = -102 : -987

GYRO yAxis = -102 : 1780

GYRO zAxis = -102 : -621

Sensor Time = %f

Sensor Temp = %f

ACC xAxis = -2777 : -33

ACC yAxis = 1201 : 14

ACC zAxis = 9648 : 117

GYRO xAxis = 758 : -3158

GYRO yAxis = 758 : -725

GYRO zAxis = 758 : 4621

Sensor Time = %f

Sensor Temp

 

(sorry, can't figure out how to add the code things)

 

At least we have numbers. This was a sample after shaking the board a bit.

 

As you can see, time and temp are not printed correctly.

 

Does the gyro work? Yes. Does the accelerometer work? Yes. Does it work out of the box with the code actually working? No.

 

At least... it works... that's a plus... right?

 

Will be experimenting with BLE soon... need to figure out swift.

 

The wait_ms doesn't work. Needed to use wait_us instead after including the correct library.

 

 

The libraries weren't written the best, and some changes were needed. Perhaps at the time of writing, 3 years ago, it was still correct, but it's Mbed OS 6 now, which is far different than the Mbed OS 2 it was written for.

  • Sign in to reply

Top Comments

  • Jan Cumps
    Jan Cumps over 2 years ago +1
    (sorry, can't figure out how to add the code things) Select the code in the editor, then:
  • Andrew J
    Andrew J over 2 years ago +1
    It does seem fairly common for example code to not keep up with iterations of the thing they are examples for. In my experience, adaptation in the way you have done, is normal and I don’t mind doing that…
  • raspberrypitechguy
    raspberrypitechguy over 2 years ago in reply to Andrew J

    Indeed it is.

     

    I don't know if I mentioned in the post, but these libraries are written for Mbed OS2... 4 iterations behind.

     

    It would be too busy for them but not maintaing a board, and giving source code from 3 years ago is not very good practice.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Andrew J
    Andrew J over 2 years ago

    It does seem fairly common for example code to not keep up with iterations of the thing they are examples for.  In my experience, adaptation in the way you have done, is normal and I don’t mind doing that but personally, I think they should create new examples with each iteration that introduces changes to keep the overall body of examples expanding.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • raspberrypitechguy
    raspberrypitechguy over 2 years ago in reply to Jan Cumps

    Thank you!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 2 years ago
    (sorry, can't figure out how to add the code things)

    Select the code in the editor, then:

    image

     

    • Cancel
    • Vote Up +1 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 © 2023 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

  • Facebook
  • Twitter
  • linkedin
  • YouTube