Issues uploading Scene 3: Obstacle -Avoidance Car on mBot


#1

Hello everyone

I am trying to upload the mBot avoidance car example on my unit but I am facing few issues.
Initially the necessary libraries weren’t installed although I dowloaded them from github (https://github.com/Makeblock-official/Makeblock-Library/archive/master.zip)
For ex mBot.h, meUltasonic.h, ecc were missing and had to install them manually, is this normal?

Now once I got the libraries, I verifyed the code in the Arduino IDE but I am getting several error messages , seems still linked to the libraries, as a result I can’t complete the upload.

Is there anyone able to point me in the right direction to solve this issue?

Thank you
Stefano


#2

I suppose you are not referring to the mode B option of the factory defaults, right?

I also had a problem with the interaction of mBlock and Arduino IDE. In my case the IDE didn’t want to compile the code, since it didn’t find “mCore.h”. But after I re-installed Arduino IDE and removed the library extensions I had dropped into ~/Documents/Arduino/libraries, it started to work again.

So I have the feeling that there are some issues with how the libraries of mBot are integrated into the Arduino IDE, and so re-installing the latter might help.

Furthermore, on a Mac, if you want to install a new version of mBlocks, it might be wise to first remove the old installation. I would do this procedure, even if I wanted to re-install the same version!


#3

Hi Thanks for taking the time to answer.
What I am experiencing is quite odd as the libraries keep continuing to disppear from the Arduino folder after I try to upload to Arduino.
Every time I have to check the libraries are present before doing this operation.
Second point is that I have tested the Scene 1: Line-Following Car and it gets uploaded correctly. So for the moment what I am led to believe is that there is something happening between mBlock and the Arduino upload specifically on the mBot avoidance car example.

Can you upload this one correctly?


#4

I only tried to run some examples for the ultrasonic sensor, since it was not working when I received the mBot (to say with the original factory software). Even though I was successful in compiling the mBot code, the collision avoidance didn’t work.

For the sample code, as I mentioned, at first I had a compile time error (mCode.h). With some fiddling around I was able to get it compiled and then realized that I got continuous “0cm” measurements. This first lead me to think, that the examples from the Makeblock wiki were for sensor version 2, while I had version 3, so I expected to need new libraries.

Later I reinstalled everything (mBlock, Arduino IDE) and suddenly I could compile and even run it. The measurements were mostly non-zero, while every third one was null. This is strange, since in the sample code, the mBot would make a reverse move with a null measurement. I’ll have to track that.

Why I’m mentionning the re-install: I think in one of the posts I read by some other forum member, that he was complaining about getting a new mBlock package, which had the exact same version number as a previous one. Don’t know whether this is really true, but it suggests that the developers of mBlock didn’t take versioning too serious… I hope this is not true! :smile: