Basic newbie questions


#1

Hi everyone!

I assume these questions are basic and I just don’t know the answers because I’m very new at this. I bought mBot for my son and am trying to program it to be used with a wireless ps2 controller, but also just have some basic questions with terminology that I’ve come across in my research.

I assume that what I’m doing is writing a “program” when I copy and paste the code from this page:

is that a “program” or an “extension”… or do they mean the same thing?

When I copy and paste this in Arduino mode, it tells me that it can’t find the .h files in the “library”. I know there are a library of files, and I’ve tried adding these to them, but it still tells me I can’t find them, so I assume I’m putting them in the wrong place. How can you add files to the mblock library?

After this, I downloaded Arduino IDE from the Arduino.cc website. I WAS able to successfully add the files and didn’t get the same error from the mblock program of “can’t find meUSB.h”, but upon copying and pasting the code from the above website, and then hitting “upload”, it gives me the error of “programmer not responding”.

What is a “programmer”? I notice that there is a section under “tools” for “programmer” and a long list of different ones… how do I know which one?

I’ve also read in numerous places that to upload a “program” to mBot you need an actual usb cable. Is that something that I need to purchase separately, or did it come with mBot? I saw two for sale on the makeblock website- which one do I need (if i need one) ?

Thanks in advance!!


#2

Generally speaking, you’d put the Makeblock libraries in the “libraries” directory in the sketchbook (see your preference in the Arduino IDE to locate the libraries directory). From that point the Arduino IDE should be able to locate all of the .h header files associated with the Makeblock libraries. If you are using the Arduino IDE that comes with mBlock, the libraries will already be set up. Be aware that if you have a separate installation of the Arduino IDE that you may experience some issues depending on which version of the IDE you have launched. Presumably if the sketchbook locations point to the same place you should be fine, but…

The “programmer” is the avrdude onboard programmer on the mCore microcontroller board. You must be connected to the robot via the USB cable that should have come with the kit. You cannot upload programs via WiFi or Bluetooth because those act as pure serial connections and cannot access the avrdude programmer. You will need to select the Arduino/Genuino board from the boards menu and make sure that you set the baud rate in the setup() method. Accordingly if you are using the serial monitor for debugging be sure that it is set to the same baud rate.

For what it’s worth, I’m writing a book that provides an intro to using the Arduino IDE with the mBot that will be published this year barring any unforeseen circumstances. I’ll be posting a link when it’s available.

Regards,

Chuck


#3

Chuckmcknight,

Thank you so much for your help, and for your fast reply!

Best