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

ch32v003 i2c shared example #81

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

fatfingers23
Copy link

@fatfingers23 fatfingers23 commented Jan 24, 2025

I've been enjoying this crate and trying out this little microcontroller with Rust. While testing it out and seeing what it could do with a little demo project, I needed 2 i2c devices and came up with this solution that works, as shown in the video. The demo reads from an SCD40 sensor, then displays it to an OLED SSD1306 and bounces like a DVD logo. I'm unsure if it really counts as a bus, but it works for me.

A couple of things on it

  • I based this example off of embassy's rp example. I used a dummy device as they did, but I can also change it to use an actual crate if preferred
  • I did try to break this out into tasks and did get it to build with StaticCell version 1.3 and blocking i2c. But the minute it passed the i2c bus to another task it would panic and have not been able to get panic messages to print on the ch32v003.
output.mp4

@fatfingers23 fatfingers23 changed the title Feature/v003 i2c examples ch32v003 i2c shared example Jan 24, 2025
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.

1 participant