Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example of using i2c with the bme280 air sensor #313

Merged
merged 3 commits into from
Jul 29, 2021

Conversation

fishrockz
Copy link
Contributor

@fishrockz fishrockz commented Feb 27, 2021

I created this example for my self as a reference for a more complex use of the bme280 sensor. And thought it might be nice to share.

I noted the comments in #24 that it seems like you don't want examples of real hardware, but I don think this is explicitly stated. Would you like a example like this? I might offer it to the bme280 crate but there example is i2c master agnostic, ill just put it on my blog as reference if this is not the place for it, but i think it will be much more easily discoverable here.

You can get bme280 breakout boards for less than £20 in the uk, eg https://thepihut.com/products/adafruit-bme280-i2c-or-spi-temperature-humidity-pressure-sensor so there pretty cheap and cheerful so it seems like a nice thing to use as a example as its cheap and you can see the values change quite quickly if you put your finger on it or blow on it.

If you would like it how would you like the dep added? the way i have added it, it is only ever built if some one asks for it but it might be nicer as a dev dep, but i don't think they can be optional.

@fishrockz fishrockz changed the title Example of useing i2c with the bme280 air sensor Example of using i2c with the bme280 air sensor Feb 27, 2021
@burrbull
Copy link
Member

Rebase, please.

@TheZoq2
Copy link
Member

TheZoq2 commented Jul 26, 2021

I don't think we should add deps for examples, but I would also like to have a way to have example code like this, perhaps in a separate repo?

@eldruin
Copy link
Member

eldruin commented Jul 27, 2021

If you are interested, I have a lot of examples using this HAL here

@TheZoq2
Copy link
Member

TheZoq2 commented Jul 27, 2021

Oh nice, that's a great resource. Would you mind if we make that more official by linking to it in the readme and directing examples like this one there? @eldruin

@eldruin
Copy link
Member

eldruin commented Jul 27, 2021

Sure, I would be happy if it gets more visibility. I have tried to write many self-contained examples for different devices.

@fishrockz
Copy link
Contributor Author

Sorry, I didn't notice the conversation on this. The dep is only acitve if requested as a feature, other repos like Druid support examples that need extras like that.

If this example is useful i can look up adding the dep as part of the example, i think that's possible. i didn't want to put too much effort in to meta stuff like that until I knew if it would be helpful.

Might this be merged if i can sort out the deps?

@fishrockz
Copy link
Contributor Author

@burrbull this is re-based now, if you are interested.

@burrbull
Copy link
Member

LGTM

@TheZoq2
Copy link
Member

TheZoq2 commented Jul 29, 2021

Oh cool, in the current state, I think this is a great change, thanks!

@TheZoq2 TheZoq2 merged commit b2682bd into stm32-rs:master Jul 29, 2021
@pdgilbert pdgilbert mentioned this pull request Jan 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants