Comments (3)
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.
Added an init
example into docs in #12.
from bno055.
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)
- Function signature for usage code HOT 2
- Combination BNO055 and BME280 HOT 1
- std support HOT 2
- Thank you!
- I2c Device Ownership HOT 1
- Mint is not no_std HOT 6
- README example code seems to be outdated HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bno055.