MatrixMiniR4 1.1.5
Matrix Mini R4 Arduino Library API Documentation
Loading...
Searching...
No Matches
Matrix Mini R4 Library Documentation

R4

The MatrixMiniR4 library is a versatile library designed for robotics and automation projects. It provides simplified access to a wide array of functionalities such as motor control, sensors, buttons, and communication protocols. This documentation provides detailed insights into the use of the MiniR4 controller and its built-in modules.

Quick Start

The MatrixMiniR4 library includes a pre-configured object named MiniR4 that provides easy access to all the functions. You can interact with the various components connected to your MiniR4 controller using this object.

Here are a few examples:

MiniR4.D1.getL(); // Get Digital Port 1 Left status.
MiniR4.BTN_UP.getState(); // Get Upper Button status
MiniR4.M1.setSpeed(80); // Set Motor Port 1 speed 80
MiniR4.I2C4.MXLaser.getDistance(); // Get MXLaser distance on I2C Port 4
MatrixMiniR4 MiniR4
The MiniR4 Main Object.
uint16_t getDistance()
Gets the distance measured by the laser sensor.
MiniR4DC< 1 > M1
Port M1 DC 5V Motor.
MiniR4BTN< 2 > BTN_UP
Up Button.
MiniR4I2C< 3, &Wire1 > I2C4
Port I2C4.
MiniR4PWM< 3, 2 > D1
Port D1 (p3, p2)(only LEFT support PWM)
bool getState(void)
Retrieves the current state of the button.
Definition MiniR4BTN.h:34
bool setSpeed(int16_t speed)
Sets the speed of the DC motor.
Definition MiniR4DC.h:86
bool getL(bool pullup=false)
Reads the state of the first pin.
MatrixLaser MXLaser
Matrix Laser sensor instance.
Definition MiniR4I2C.h:64

For Full class referecne of MiniR4 object please visit MatrixMiniR4 Class List.

Pin Definition of Controller

For users who prefer to use pure Arduino functions, here is the Pin Definition table:

Port of MiniR4 Pin of Arduino Uno R4 WiFi
D1 L.(A), R.(B) D3, D2 (only D3 support PWM)
D2 L.(A), R.(B) D5, D4 (only D5 support PWM)
D3 L.(A), R.(B) D12, D11 (only D11 support PWM)
D4 L.(A), R.(B) D13, D10 (only D10 support PWM)
A1 L.(A), R.(B) A1, A0 (only A0 support DAC)
A2 L.(A), R.(B) A3, A2
A3 L.(A), R.(B) A4, A5
I2C 1-4 I2C Multiplexer Channel 0 - 3
I2C 0 MiniR4 Port A3
UART Serial1
UART(USB) Serial
DC Motor & Encoder Control by Lower STM32
RC Servo Control by Lower STM32

Pins

Other Resource

MiniR4 Controller Datasheet *Datasheet URL might be change, you can find on our Website->Downloads->Resources

MATRIX Official Website

Contribute and Report Issues

We welcome contributions to the MatrixMiniR4 library! Whether you have a great idea for a new feature or have encountered a bug, we encourage you to participate in improving the project.

How to Contribute

  • Fork the repository on GitHub.
  • Create a new branch for your feature or bug fix.
  • Once your changes are complete, open a pull request for review.

Reporting Bugs

If you find a bug, please report it by creating a new issue in our GitHub repository. When submitting a bug report, please include:

  • A clear description of the issue.
  • Steps to reproduce the bug.
  • Any error messages or logs, if applicable.
  • The version of the library and hardware you're using.

You can find our GitHub repository here: MatrixMiniR4 GitHub Repo

We appreciate your feedback and contributions!

License

This project is licensed under the MIT License.