Nothing yet
bmp280's Introduction
bmp280's People
Forkers
gambrosebmp280's Issues
Invalid parsing of raw measurements
In your test you have RawPressure::from_bytes(&hex!("4E 54 80"))
I make that this should have a value of 320840 but it actually gives 320960.
repo:
#[test]
fn parse_raw_pressure() {
use super::RawPressure;
let raw_pressure = RawPressure::from_bytes(&hex!("4E 54 80"));
assert_eq!(320840, raw_pressure.0);
}
I think this is because we are not taking the top nibble from the xlsb register.
I think that this:
pub fn from_bytes(bytes: &[u8]) -> Self {
Self((bytes[0] as i32) << 12 | (bytes[1] as i32) << 4 | (bytes[2] as i32))
}
should be changed to something like this:
pub fn from_bytes(bytes: &[u8]) -> Self {
let msb = (bytes[0] as i32) << 12;
let lsb = (bytes[1] as i32) << 4;
let xlsb = (bytes[2] as i32) >> 4;
Self(msb | lsb | xlsb)
}
i2c bus
Am I right in thinking that as it stands it is not possible to use this lib with a BMP280 connected to an i2c bus?
I am fairly new to rust but from looking over the code I think I would need to implement an I2cBus
that implemented the Bus trait.
I am happy to try and put together a PR but wanted to reach out first as I might need some help, guidance as this is my first embedded rust project.
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.