Exercise C: Adaptation Challenge

~15 min

The Challenge

You found multiple devices on the I2C bus in Exercise A. You've used a driver crate for one of them. Now try the other.

What to Do

  1. Identify the second sensor from your bus scan results
  2. Search crates.io for a driver crate — does one exist?
  3. Read the driver crate's docs.rs page — find new(), figure out what it needs
  4. Add it to your projectcargo add sensor-name
  5. Create, configure, control — same pattern, different device

No Hints

This is pure ecosystem navigation practice. Everything you need is on crates.io and docs.rs. You've done this once already — now do it independently.

If No Second Sensor

If your uFerris board only has one I2C device, try one of these instead:

  • Read ALL available data from the first sensor — not just the one reading from the example. How many different measurements can you get?
  • Change every configurable setting on the driver and observe the effects
  • Implement formatted output — print readings in a human-readable format with units

Reflection

You've now navigated from raw I2C bytes to high-level sensor readings, using two separate layers of documentation. The same workflow works for any sensor, any bus protocol, any microcontroller.

Next up: interrupts — making things happen without polling in a loop.