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

§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.
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.
Movement
Driver for the Modulino Movement module (LSM6DSOX IMU).
MovementValues
3-axis measurement values.
Pixels
Driver for the Modulino Pixels module.
Thermo
Driver for the Modulino Thermo module (HS3003 sensor).
ThermoMeasurement
Temperature and humidity measurement.
Vibro
Driver for the Modulino Vibro module.

Enums§

Error
Error type for Modulino operations.
Hs3003Error
Errors that can occur when interacting with the sensor
Note
Musical note frequencies in Hz.
PowerLevel
Predefined power levels for the vibration motor.

Type Aliases§

Result
Result type alias for Modulino operations.