Giter Site home page Giter Site logo

Comments (3)

eupn avatar eupn commented on May 27, 2024

Hello! dyn DelayMs means that we're using dynamic dispatch to specify that we only care about types that implement the DelayMs trait. Usually, implementations of the embedded-hal have types that implement DelayMs via hardware-dependent means like ARM's SysTick or linux's thread::sleep() under the hood. For linux_embedded_hal, I think you've correctly imported the Delay struct. It should be initialized as a mutable binding to an empty struct, e.g.: let mut delay = Delay {}. Then, you should pass a mutable reference to this binding into Bno055's init() function:

let mut delay = Delay {};
// ...
bno055
    .init(&mut delay) // <- here we're passing dyn DelayMs by mutable reference
    .expect("Error initializing the IMU");

For an address issue, you could try to remove a call to with_alternative_address() for it to probe a default address. And could you please share an i2cdump's output that you're getting for 0x28 and 0x29 addresses?

Hope this will help!

from bno055.

eupn avatar eupn commented on May 27, 2024

Added an init example into docs in #12.

from bno055.

quietlychris avatar quietlychris commented on May 27, 2024

Ah, thank you! Knowing the right way to implement the Delay struct was helpful, since it helped to eliminate one of my unknowns, and I think I have it figured out. I'm not particularly used to the way that dynamic dispatch works, so thought the empty instantiation was just standing in for environment-specific code I had to implement.

If it's helpful for anyone else, I've created a new repository with my (now working) code sample for the Odroid-C4 board at https://github.com/ucsb-coast-lab/read_bno055 , which also has a reference for the Adafruit-library-based Python implementation

Also, it might be worth noting that the most recent version of linux-embedded-hal on crates.io (0.4.0-alpha.0) doesn't play well with the existing code because of some missing trait implementations, so it's probably worth sticking with v0.3 for now.

from bno055.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.