mBlock to Arduino code?


#1

Hello Guys,
So i create the project in mBlock mode but i would like to see the code behind it.How do i convert that to Arduino code?
Thanks,
Slav


#2

Hello,

Right-click on the start block to open a contextual menu. You should see a “upload to arduino” option.
It will display the C Arduino code.
Hope it helps

BR,
Cyril.


#3

Hello Cyril,
Thank you for your response. I tried to open Arduino extension but it doesn not display the correct code. If you take a look on the snapshot i too, i have the mBlock logic on the right but it is not reflected in Arduino environment on the left. Am i doing something wrong?
Slavisha


#4

Actually, I think you need a starting block “Makeblock program” on the top of your program that does not involve computer input, like the keyboard, but things like IR sensor.
And instead of using “When X key pressed”, you may have to use “if” blocks in a “forever” loop.

If you want to pilot your robot with your computer keyboard you just have to use the firmware that comes with mBlock (Connect > Upload firmware), and if you want to see the code of this firmware, it’s available here : Connect > Firmware

BR,
Cyril


#5

I see,
I will work on this and give it a try. Thank you Cyril.
Slav


#6