The tool’s interface below is still in French. The interface is being translated by Google Translate.
From mBlock blocks to Arduino code
Every mBot block has a C++ equivalent. Search for a block, tick the ones you want, copy the program.
Programme avec les blocs cochés
Passer au code, en pratique
- Dans mBlock, basculez l’appareil en mode « Téléverser » : un panneau affiche le code Arduino généré à partir de vos blocs.
- Dans le logiciel Arduino, installez la bibliothèque Makeblock (fichier ZIP à ajouter par Croquis › Inclure une bibliothèque).
- Choisissez la carte « Arduino Uno » : la carte mCore du mBot repose sur le même microcontrôleur.
- Structure d’un programme : setup() s’exécute une fois au démarrage, loop() se répète sans fin, comme un bloc « répéter indéfiniment ».
- Pour revenir aux blocs, il faut remettre le micrologiciel d’origine depuis mBlock (Mettre à jour le micrologiciel).
Les libellés des blocs peuvent varier légèrement d’une version de mBlock à l’autre ; les instructions C++ sont celles de la bibliothèque Makeblock pour la carte mCore.
How to use the mBlock to Arduino lookup table
For each mBot block, the equivalent C++ instruction with the Makeblock library, and a complete program to put together.
-
Search for a block
By keyword or category.
-
Tick the blocks you need
The program builds up.
-
Copy the code
Or download the file.
About the mBlock to Arduino lookup table
Going from blocks to text is a key step in learning: the structure stays the same, only the writing changes. “Forever” becomes the loop() function.
Each line explains why the instruction is there, for example the inverted sign of the left motor.
Frequently asked questions about the mBlock to Arduino lookup table
Which board should I pick in the Arduino software?
Arduino Uno: the mCore board uses the same microcontroller.
How do I go back to blocks?
By restoring the original firmware from mBlock.
Are the blocks identical to those in mBlock?
Labels may differ slightly depending on the mBlock version; the logic and the Arduino code stay the same.