Arduino IDE source code for mBot 2 Shield Board


#1

Hello,

I have a Mbot2 (Mbot Neo).

I am using ESP32 library under Arduino IDE to compile and load CyberPi software (instead of using mBlock tool) . I am for exemple able to run the ESP32 Arduino BLE code example to run a Bluetooth server on CyberPI (to which I can connect from my mobile phone with a BLE scanner app).

I now would like to add some code in my CyberPi software in order to control the motors of my mBot2. To do so, CyberPi needs to send motor commands through the mBot2 Shield Board.

I had a look at Makeblock libraries here : https://github.com/Makeblock-official/Makeblock-Libraries/tree/master/src. It seems that file MeShield.h should be used for the Shield Board GPIO mapping. But it is not clear to me if file MeShield.h is the right file to be used for the mBot2 Shield Board. Could you please confirm that file MeShield.h corresponds to the Shield Board of mBot2 ?

Moreover, I can also see under https://github.com/Makeblock-official/Makeblock-Libraries/tree/master/src following software examples : Me_DCMotor and Me_EncoderDriver_New. Are those examples supposed to run on mBot2 ? If not, could you tell me where to find source code to control the mBot2 Shield Board (by running software on CyberPi plugged on mBot2 Shield Board) ?

Thank you
Best Regards


#2

Hmm, I’ll be back to work on here on April the 16th.
Good luck till then!
@Jeannop


#3

Hello,

Thanks for your message. It would be great if you can give some advice about which library code to use to control the mBot2 Shield Board.

Thank you.


#4

I looked into this and can’t find out much. You can ask support via email (support@makeblock.com). Sorry. :confused:
Good luck, @Jeannop!


#5

This is an AI response. Verify information.

@Jeannop

Certainly! Let’s break down your questions:

  1. MeShield.h for mBot2 Shield Board:

    • The MeShield.h file is indeed used for GPIO mapping related to the Shield Board. However, it’s essential to clarify that the mBot2 Shield Board is equipped with a built-in rechargeable lithium-ion battery and serves as the power supply for the CyberPi.
    • To control the motors of your mBot2, you’ll need to interact with the mBot2 Shield Board. While MeShield.h is relevant for general Makeblock shields, it might not be directly applicable to the mBot2 Shield Board.
    • For specific motor control on the mBot2 Shield Board, you should explore other libraries or code examples.
  2. Software Examples for mBot2:

    • The Me_DCMotor and Me_EncoderDriver_New examples are part of the Makeblock Libraries. However, their compatibility with the mBot2 depends on the specific hardware configuration.
    • To find source code specifically tailored for the mBot2 Shield Board, I recommend checking the official Makeblock documentation or exploring other community resources.
  3. Programming Options:

    • You can program the mBot2 using mBlock 5 or the Arduino IDE.
    • mBlock 5 provides both a block-based graphical editor and a Python editor for more advanced programming.
    • If you choose to use the Arduino IDE, you’ll need to find or create code that directly interacts with the mBot2 Shield Board components (such as motors).

Remember to refer to the official Makeblock documentation for detailed instructions and examples specific to the mBot2 Shield Board. Happy coding! :blush::robot:¹⁵⁷

Let me know if you need further assistance!.

(1) Arduino IDE source code for Mbot2 Shield Board. Arduino IDE source code for mBot 2 Shield Board.
(2) mBot2 Shield | Makeblock Education. https://education.makeblock.com/help/mbot2-shield/.
(3) mBot2 Operation Guide | Makeblock Education. https://education.makeblock.com/help/mbot2-start/.
(4) Program mBot in Arduino IDE – Makeblock Help Center. https://support.makeblock.com/hc/en-us/articles/4419572961943-Program-mBot-in-Arduino-IDE.
(5) GitHub - Makeblock-official/Makeblock-Libraries: Arduino Library for … https://github.com/Makeblock-official/Makeblock-Libraries.
(6) How can I program MBot using Arduino ide instead of MBlock. How can I program MBot using Arduino ide instead of MBlock.
(7) FAQs on mBot2 | Makeblock Education. https://education.makeblock.com/help/faqs-on-mbot2/.
(8) Makeblock-Libraries/examples/Me_EncoderDriver_New … - GitHub. https://github.com/Makeblock-official/Makeblock-Libraries/blob/master/examples/Me_EncoderDriver_New/EncoderMotorChangeI2CDevID/EncoderMotorChangeI2CDevID.ino.
(9) undefined. https://github.com/Makeblock-official/Makeblock-Libraries/tree/master/src.
(10) undefined. https://codeload.github.com/Makeblock-official/Makeblock-Libraries/zip/master.
(11) undefined. http://3dbuild.makeblock.com/player/index.html?id=mbot2_0.
(12) pinterest.com. https://www.pinterest.com/pin/arduino-uno-smd-a000073-board-rev3--366550857146739658/.

  • This response was helpful
  • This response was not helpful

0 voters

@Best_codes


#6

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.