Author: Aleksandr Grigorev
What is "AdvancedArduino"
"AdvancedArduino" is an extension for the mBlock visual programming environment , which can be used instead of basic "Arduino" extension, and has a lot of extra options when working in Arduino mode.
The description of AdvancedArduino extension v1.0 (old version) see here:
(русская ссылка) (English link)
Installing the AdvancedArduino Extension
First method
● Run mBlock and select Extensions -> Manage Extensions from the menu. The extension list will be downloaded from MakeBlock website.
● Type "AdvancedArduino" in the "Search" field. You will see the "AdvancedArduino" element on the list.
● Click on the "Download" button of the "AdvancedArduino" element.
Second method
● Download or copy "AdvancedArduino.zip" file to your computer.
● Run mBlock and select Extensions -> Manage Extensions from the menu, then click on the "Add Extension" button.
● Select the file type "zip-file", scroll to the downloaded archive, then click on the "Open" button.
If you have any questions, look at the additional instructions from the Makeblock developers:
http://www.mblock.cc/docs/create-extensions-for-mblock/
Examples of using the AdvancedArduino extension
Sample 1
Blocks with custom code snippets (Arduino IDE code, "Wire" programming language) in a graphical script.
Attention! When mBlock generates Arduino code sketch, it comments out the code () and def () block values using the /* and */ directives. To make the code fragment visible to the compiler, it is necessary to put the CLOSE "bracket" ( */ ) in the BEGINNING, and the OPEN “bracket” ( /* ) at the END.
Sample 2
Рort number in the function parameter.
Sample 3
"Counter" block and "repeat" loop (use Serial monitor).
Sample 4
Рort number in the function parameter and "counter" block.
Sample 5
Transmitting of messages from Serial2 to Serial, an explicit conversion of the value to char type.
Use with ME Auriga or Arduino Mega 2560, use "Auriga Program" header or "Advanced Arduino Program" header.
Sample 6
Blocks with library Arduino functions (value conversion functions).
Sample 7
Variables of any digital type (demo of overflow with byte variable).
Sample 8
Variables of any digital type (how to calculate factorial).
Sample 9
Using arrays.
Sample 10
Define custom functions that return values.
Sample 11
The "line" addition of the custom code snippets.
Sample 12
Using the text file saved on the disk.
The disk must contain a text file with the appropriate name and content. If it is necessary, change the path to this file in your script.
Contents of the text file:
Sample 13
2D arrays (multiplication table).
Sample 14
String variables.
Sample 15
"Length" method with String objects. Names matching (visual blocks and text code).
Sample 16
Morse transmitter based on mCore controller.
"morse-ext-Dat.txt" file
Sample 17
Array of functions
Sample 18
Running shadow processes (use the name "myUpdateFunction" for your custom block).
Sample 19
Several shadow processes. Use mBot educational kit with Servo Pack and 3-axis Gyro module
Sample 20
Shadow processes. "Static" local variables.
Sample 21
Shadow processes. "Static" local variables with similar names.
Sample 22
External interrupts. Use names "myHandlerFunction0", "myHandlerFunction1", etc. for your custom blocks. Use "volatile" variables.
Sample 23
Compound operators. Increment, decrement, side-effects.
Sample 24
Scheduled processes. Use names "myScheduledFunction1", "myScheduledFunction2", etc. for your custom blocks.