Skip to content

Arduino Uno + BME280 compilation error #340

Answered by Rahix
rkudryashov asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, the problem is that the library in question uses embedded-hal version 1.0.0-alpha.7 (https://github.com/VersBinarii/bme280-rs/blob/efd5a52273014d98d41b85e454142c5c75ef6139/Cargo.toml#L16) while we're still using 0.2.7. These two are incompatible so there isn't an easy way to get them to work together...

What you can try doing is building a compatibility wrapper around our type which then implements the trait from 1.0.0-alpha.7. Something like this:

Cargo.toml

[dependencies.eh-alpha]
package = "embedded-hal"
version = "1.0.0-alpha.7"

main.rs

use eh_alpha::i2c::blocking::I2c as I2cAlpha;

struct WrappedI2c<T>(T);

impl<T> I2cAlpha for WrappedI2c<T>
where
  T: embedded_hal:: /* old I2c t…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@rkudryashov
Comment options

@rkudryashov
Comment options

@rkudryashov
Comment options

@Rahix
Comment options

@rkudryashov
Comment options

Answer selected by rkudryashov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants