Skip to main content

Crate modulino

Crate modulino 

Source
Expand description

§Modulino

A hardware-agnostic, no_std Rust driver for Arduino Modulino breakout boards.

This crate provides drivers for the following Modulino devices:

  • Buttons - Three-button module with LEDs
  • Buzzer - Piezo speaker module
  • Pixels - 8 RGB LED module (APA102-compatible)
  • Distance - Time-of-Flight distance sensor (VL53L4CD)
  • Movement - IMU module (LSM6DSOX accelerometer/gyroscope)
  • Knob - Rotary encoder with button
  • Thermo - Temperature and humidity sensor (wraps hs3003 crate)
  • Joystick - Analog joystick with button
  • LatchRelay - Latching relay module
  • Vibro - Vibration motor module
  • LedMatrix - 12x8 LED matrix display
  • Pressure - Barometric pressure and temperature sensor
  • Light - RGB and ambient light sensor

§Example

use modulino::{Pixels, Color};

// Create a Pixels instance with your I2C bus
let mut pixels = Pixels::new(i2c)?;

// Set the first LED to red
pixels.set_color(0, Color::RED, 50)?;

// Apply the changes
pixels.show()?;

§Features

  • defmt: Enable defmt debug formatting for error types

§Hardware Requirements

All Modulino devices communicate over I2C at 100kHz. They use the Qwiic/STEMMA QT connector standard for easy daisy-chaining.

Modules§

addresses
Default I2C addresses for Modulino devices.
pinstrap
Pinstrap address map for device type detection.

Structs§

ButtonLed
LED state for a single button LED.
ButtonState
Button state representation.
Buttons
Driver for the Modulino Buttons module.
Buzzer
Driver for the Modulino Buzzer module.
Color
Represents an RGB color.
Distance
Driver for the Modulino Distance module.
Hub
Driver for the Modulino Hub (TCA9548A I2C multiplexer).
HubPort
A helper representing a specific port of the Hub.
I2cDevice
Helper struct for I2C operations.
Joystick
Driver for the Modulino Joystick module.
Knob
Driver for the Modulino Knob module (rotary encoder).
LatchRelay
Driver for the Modulino Latch Relay module.
LedMatrix
Driver for the Modulino LED Matrix module.
Light
Driver for the Modulino Light module (LTR-381RGB sensor).
LightMeasurement
Measurement result from the Light sensor.
Motors
Driver for the Modulino Motors module.
Movement
Driver for the Modulino Movement module (LSM6DSOX IMU).
MovementValues
3-axis measurement values.
OptoRelay
Driver for the Modulino Opto Relay module.
Pixels
Driver for the Modulino Pixels module.
Pressure
Driver for the Modulino Pressure module (LPS22HB sensor).
Thermo
Driver for the Modulino Thermo module (HS3003 sensor).
ThermoMeasurement
Temperature and humidity measurement.
Vibro
Driver for the Modulino Vibro module.

Enums§

DecayMode
Supported motor current decay modes.
DisplayMode
Display mode for the LED Matrix.
Error
Error type for Modulino operations.
Gain
Available gain settings for the LTR-381RGB sensor.
Hs3003Error
Errors that can occur when interacting with the sensor
MeasurementRate
Available measurement rates for the LTR-381RGB sensor.
Note
Musical note frequencies in Hz.
PowerLevel
Predefined power levels for the vibration motor.
Resolution
Available ADC resolutions for the LTR-381RGB sensor.

Type Aliases§

Result
Result type alias for Modulino operations.