Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
0f63e27
Fix setColor bug for whole ring color
nbourre Oct 6, 2022
24348b0
Fixed method signature type error and typos
nbourre Oct 18, 2022
6c19015
Comments
nbourre Oct 18, 2022
463fd05
Added gitignore
nbourre Sep 29, 2023
c59de3e
Removed .vscode cached
nbourre Sep 29, 2023
22b96ba
vscod things
nbourre Sep 29, 2023
223dba3
Added Wire.h inclusion
nbourre Sep 29, 2023
95761ca
Added the missing getGyroZ
nbourre Sep 29, 2023
a3d6eda
Updated the library properties
nbourre Sep 29, 2023
ecdebf6
semver.org compliant version number
nbourre Sep 29, 2023
17c8b18
Added the resetData function
nbourre Sep 29, 2023
d540ab4
bugfix
Oct 5, 2023
7b86ccb
Bugfix and code readability
Oct 5, 2023
2e97c9f
Updated lib properties
Oct 5, 2023
042fbb4
Added gyro default address for Auriga
nbourre Oct 5, 2023
e5c6fbf
Updated readme
nbourre Oct 16, 2023
97e15e3
Added Issues section in readme
nbourre Oct 16, 2023
64b741c
Removed MeAuriga check in MeGyro
nbourre Oct 16, 2023
76e5b23
Added Auriga Gyro Test
Nov 8, 2023
239315d
Added a way to ignore ir by default
nbourre Dec 2, 2023
9c897af
comment
nbourre Dec 2, 2023
bd9a59a
Merge pull request #1 from nbourre/ignore_ir
nbourre Dec 2, 2023
29ce522
Ajout de la documentation Doxygen
nbourre Dec 2, 2023
cbecc97
Merge branch 'master' of https://github.com/nbourre/Makeblock-Libraries
nbourre Dec 2, 2023
b1151a0
Deplacement accidentel d'un fichier
nbourre Dec 4, 2023
a6778f1
Removed the IGNORE_ME_IR,. We can use the tone from buzzer
nbourre Dec 18, 2023
6d394d0
Added some comments
nbourre Sep 13, 2024
4a0455d
Added an auriga folder for testing
nbourre Sep 13, 2024
252759f
Modified "How to use"
nbourre Sep 17, 2024
358e490
Added a personnal note.
nbourre Sep 17, 2024
e3596eb
Changed type for time management
nbourre Sep 17, 2024
8822fdb
Added RGB Line Follower
nbourre Apr 30, 2025
92e034e
Added documentation
nbourre May 1, 2025
8f0f902
Added GPT generated documentation
nbourre May 1, 2025
d64422b
Correction de la documentation
nbourre May 1, 2025
2915647
Added a demo for Me_RGBLineFollower
nbourre May 1, 2025
865fec3
Updated the version number
nbourre May 1, 2025
ac21758
updated readme
nbourre May 1, 2025
d4fd2df
Upodated AurigaMultipleTests
nbourre Sep 3, 2025
5f95b6f
Comments
Sep 3, 2025
37e16df
fix: move board globals out of headers to .cpp to avoid multiple-defi…
nbourre Sep 13, 2025
1f51d6e
Updated the version
nbourre Sep 13, 2025
1d84682
Merge pull request #2 from nbourre/fix_multiple_def
nbourre Sep 13, 2025
b95839a
Add MakeblockBoardConfig.h (board defaults and guards)
nbourre Sep 13, 2025
4defc36
Merge pull request #3 from nbourre/rollback-master-to-5f95
nbourre Sep 13, 2025
654be67
Revert "Merge pull request #3 from nbourre/rollback-master-to-5f95"
nbourre Sep 13, 2025
a5c5349
Revert "Comments"
nbourre Sep 13, 2025
2214dc0
Revert "Merge pull request #2 from nbourre/fix_multiple_def"
nbourre Sep 13, 2025
1925324
Merge pull request #4 from nbourre/revert-to-d4fd2df
nbourre Sep 13, 2025
c6d1f5a
Refactor MeAuriga.h and MeAuriga.cpp to use extern declarations for m…
nbourre Sep 14, 2025
3217a1d
Update version to 3.28.2 in library.properties
nbourre Sep 14, 2025
a3b86d5
Added the gyro temperature and an example showing both temp sensors o…
nbourre Sep 24, 2025
09e44ec
Updated Readme.md
nbourre Sep 24, 2025
c1a2bb5
Merge pull request #5 from nbourre/temp_sensor
nbourre Sep 24, 2025
2ee9b5d
wip : Getting acceleration values
nbourre Sep 24, 2025
7f2b4a1
rename the accX,Y,Z to rawAccXYZ
nbourre Sep 24, 2025
b0bf248
Completed accelerometer methods
nbourre Sep 24, 2025
38c82e8
Updated readme
nbourre Sep 24, 2025
c9dd711
Updated the library.properties
nbourre Sep 24, 2025
a802f6f
Updated the author and maintainer
nbourre Sep 24, 2025
20513c1
Merge pull request #6 from nbourre/accelerometer
nbourre Sep 24, 2025
5f539ad
feat(MeIR): add configurable ISR toggle to resolve timer conflicts
nbourre Oct 14, 2025
28c2017
Merge pull request #7 from nbourre/accelerometer
nbourre Oct 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
57 changes: 57 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Created by https://www.toptal.com/developers/gitignore/api/c++,visualstudiocode
# Edit at https://www.toptal.com/developers/gitignore?templates=c++,visualstudiocode

### C++ ###
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/

# Built Visual Studio Code Extensions
*.vsix

### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

# End of https://www.toptal.com/developers/gitignore/api/c++,visualstudiocode
12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"files.associations": {
"deque": "cpp",
"initializer_list": "cpp",
"list": "cpp",
"vector": "cpp",
"xhash": "cpp",
"xstring": "cpp",
"xtree": "cpp",
"xutility": "cpp"
}
}
102 changes: 91 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# Makeblock Library v3.27
# Makeblock Library v3.29.1 - Updated

Arduino Library for Makeblock Electronic Modules

## Note
The original library from Makeblock is not maintained anymore. I have a fleet of Makeblock Ranger robots and I needed to fix some issues with the library. I will try to keep it up to date with the original library.

Feel free to open an issue if you have any problem with the library or create a pull request if you have a fix.

# Copyright notice

In makeblock's library, some of the modules are derived from other open source projects, and also part of some code is inspired by the algorithms of other individuals or organizations. We will retain the copyright of the original open source code.
Expand All @@ -13,6 +18,7 @@ These modules is derived from other open source projects:
- Me7SegmentDisplay
- MeOneWire
- MeStepper
- [MeRGBLineFollower](./doc/devices/MeRGBLineFollower.md)

and these modules is inspired by some projects:

Expand All @@ -22,15 +28,12 @@ As an open source library, we respect all contributors to the open source commun

If you have a discussion about licensing issues, please contact me (myan@makeblock.com -- Mark Yan)

### How to use:

1. Download the source from the git https://codeload.github.com/Makeblock-official/Makeblock-Libraries/zip/master
## How to use:

2. In the Arduino IDE: "Sketch-> Include Library-> Add .ZIP Library-> select the downloaded file-> Open"

3. Click "File-> Examples". There are some test programs in "MakeBlockDrive->"

4. Depending on the type of board you're using, you need to modify the header file to match.
1. Download the library from the Arduino Library manager
2. Search for Makeblock in the Library Manager and select `Makeblock Drive Updated`
4. Click "File-> Examples". There are some test programs in "MakeBlock Drive Updated->"
5. Depending on the type of board you're using, you need to modify the header file to match.

For example, if you're using a mCore. You should change `#include <MeOrion.h>` to `#include <MeMCore.h>`
Corresponding boards and there header file are:
Expand All @@ -47,7 +50,78 @@ If you have a discussion about licensing issues, please contact me (myan@makeblo

MegaPi <-------> MeMegaPi.h

### Revision of history:
### IR receiver / Tone (buzzer) conflict

The library includes an IR receiver implementation (`MeIR`) that uses a hardware timer ISR. Some buzzer/tone libraries (for example `Tone` or `ezBuzzer`) use the same AVR timer and will cause a linker error like:

```
multiple definition of `__vector_13`
collect2.exe: error: ld returned 1 exit status
```

To avoid this conflict you can disable the built-in IR interrupt handler. The library provides a small configuration header `src/MeIR_config.h` with a toggle:

1. Open `src/MeIR_config.h` in the library folder.
2. Uncomment the line `#define ME_IR_DISABLE_ISR` to disable MeIR's ISR.
3. Restart the Arduino IDE (or PlatformIO) to force a clean library rebuild.

When `ME_IR_DISABLE_ISR` is defined, the MeIR implementation will not define the timer interrupt vector and will not conflict with other libraries that need that timer. You can still use MeIR's send functions; however, receiving via the built-in ISR will be disabled — you'll need to poll `MeIR::loop()` or use another receiver approach if necessary.

If you prefer not to edit the library each time, create a local patch or a config file under your copy of the library (the repository includes `MeIR_config.h` for that purpose).


## New Features in v3.29.0 - Enhanced MeGyro Class

The MeGyro class has been significantly enhanced with full accelerometer and temperature sensor support for the MPU-6050 chip:

### New Methods Added:

#### Accelerometer Methods:
- `double getAccX()` - Get X-axis acceleration in g units (gravity = 1.0g)
- `double getAccY()` - Get Y-axis acceleration in g units
- `double getAccZ()` - Get Z-axis acceleration in g units
- `double getAcc(uint8_t index)` - Get acceleration for specified axis (1=X, 2=Y, 3=Z)

#### Temperature Method:
- `double getTemperature()` - Get temperature from MPU-6050 internal sensor in degrees Celsius

### Usage Example:
```cpp
#include "MeAuriga.h"

MeGyro gyro(0, 0x69); // For Auriga onboard gyro

void setup() {
Serial.begin(115200);
gyro.begin();
}

void loop() {
gyro.update();

// Read gyroscope angles (degrees)
Serial.print("Angles - X: "); Serial.print(gyro.getAngleX(), 2);
Serial.print(" Y: "); Serial.print(gyro.getAngleY(), 2);
Serial.print(" Z: "); Serial.println(gyro.getAngleZ(), 2);

// Read accelerations (g units)
Serial.print("Accel - X: "); Serial.print(gyro.getAccX(), 3);
Serial.print(" Y: "); Serial.print(gyro.getAccY(), 3);
Serial.print(" Z: "); Serial.println(gyro.getAccZ(), 3);

// Read temperature
Serial.print("Temperature: "); Serial.print(gyro.getTemperature(), 1);
Serial.println(" °C");

delay(100);
}
```

### Example Programs:
- **Auriga_MeGyroTest**: Enhanced test program with Serial Plotter compatibility
- **AurigaTempSensors**: Demonstrates reading from both gyro temperature sensor and onboard NTC thermistor

## Revision of history:

|Author | Time | Version | Descr |
|:-------- | :-----: | :----: | :----- |
Expand All @@ -61,5 +135,11 @@ If you have a discussion about licensing issues, please contact me (myan@makeblo
|Mark Yan   | 2018/05/16 | 3.2.5 | Correct copyright information.|
|Vincent He | 2019/01/04 | 3.2.6 | 1.Mbot /ranger adds the function of communication variables. 2.Solve the blocking problem of 9g steering gear. 3.Solve the problem that the intelligent steering gear cannot read back the parameters. 4.Add version number function. 5.High power code motor reinforcement version query function. 6.Solve the problem of SetColor (uint8_t index, long value) function error in mergharp.cpp. 7.The mBot board cannot extinguish the RGB. First upload the program with the RGB in any color, and then upload the program with the RGB in all colors. The RGB cannot extinguish (MeRGBLed bled. CPP file). 8.In the MegaPi firmware, SLOT1 is changed to slot_num instead of parameter transmission in the command processing stepper motor.|
|Vincent He | 2019/09/02 | 3.2.7 | 1.fix the problem that the electronic compass Mecompass is hung on the Orion mainboard 7 or 8 ports and communication will be hung dead. 2.fix the problem that the function getPointFast() in MeHumitureSensor.cpp does not normally output the value. 3.fix the problem that compile smartservo_test.ino firmware error report using the arduino1.6.5 environment with mBlock V3.4.12. 4.remove MeSuperVariable.cpp/MeSuperVariable.h. 5.fix the problem that ultrasonic module can only measure the maximum range of 375cm,and the maximum range of normal requirements is 400cm.|
| Nicolas Bourré | 2023/10/16 | 3.28 | 1. Added missing `gyro.getGyroZ`. 2. Compliant semver.org version number. 3. Added `gyro.resetData` function. 4. Modified the gyro address if it is an Auriga board. |
| Nicolas Bourré | 2025/04/30 | 3.28.1 | Added the MeRGBLineFollower class. |
| Nick B | 2025/09/24 | 3.29.0 | 1. Added `getTemperature()` method to MeGyro class for MPU-6050 internal temperature sensor. 2. Added full accelerometer functionality to MeGyro class with `getAccX()`, `getAccY()`, `getAccZ()`, and `getAcc(index)` methods. 3. Fixed multiple definition linker errors by moving MeAuriga global array initializations to .cpp file. 4. Fixed accelerometer initialization by properly configuring register 0x1c for ±2g range. 5. Added AurigaTempSensors example demonstrating dual temperature sensor reading (gyro + onboard NTC). 6. Updated Auriga_MeGyroTest example with Serial Plotter compatibility and comprehensive sensor data display. 7. Enhanced MeGyro class with proper accelerometer sensitivity handling and raw data processing. |

# Issues

### Learn more from Makeblock official website: www.makeblock.com
## Remove old MakeBlock library
If you have problem with the compiler complaining of ambiguous reference to `MePort`, you may have an old version of the MakeBlock library installed. You can remove it by uninstalling the official Makeblock library via the library manager.
Loading