I need a sample code for using the Bluetooth Remote Controller w/ mBot 2


hello all, can anyone please post the correct sample code for the remote control progrm using the makeblock bluetooth remote controller.
in the old mbot v1 i had the 'i/r remote if button ‘up arrow’ pressed then do so and so…

with the mbot 2 and the new makeblock controller, i cannt seem to make it work at all.

Newbie question mbot2 to bluetooth controller connection

@magicmarc I don’t have the controller, but I’ll see if I can guess anything for you from the docs…


thanks, yes, as im totally confused, the old mbot i/r remote commands were simple… im surprised makeblock doesnt have a simple sample remote control program using the bluetooth remote control they sell.


and y’all already sent me alot of details about the bluetooth controller, about the different ways to program the buttons, etc… but its the mblock code that im confused with even more.


It seems fairly simple.

Go here:
Add the cyberpi device:
Add the controller extension:

Then, I assume, @magicmarc, that the code would look something like this:

Let me know if you had something else in mind.


THANK YOU, ill try this tomorrow!


No problem! Let me know if you need anything else. :slight_smile:


thanks, however for some reason im haveing errors uploading, it just freezes at this point (im connected usb, mbot2 is powered on and charged, ive tried diffeent usb ports. https://www.dropbox.com/scl/fi/hlniaorss89hi9xfjs9kg/upload-error.jpg?rlkey=25pq5wbul71ltfaih4pwh8g75&dl=0upload%20error


@magicmarc With no compiler issues, this is likely a software issue and not a code issue. Try restarting your mBot, connecting to other ports (which you did), and using different IDEs (e.g., https://ide.mblock.cc, PC version, https://ide-chrome.mblock.cc/ Beta, etc.).

Let me know if you can find out anything.


im on it, THANKS AS ALWAYS! what are ide’s by the way…? when you say try different ide’s?


ahhh, ide, integrated develpoment enviromnet… i think last time, last semester i was using the mblock app… thisis a website… ill try the other,…


Yep. :slight_smile: I basically meant to ask whether you are using Web, App, what version, etc.


id ‘been’ using the app version, and trying it all now, different ports same thing, which ‘of the icons on the left’ should i be coding the blocks on, see image.


@magicmarc Can you send a full screenshot of your mBlock app? I can’t see everything there. :slight_smile:


here is a link to a dropbox file, as i think the screenshot of the entire screen isnt showing the whole image…https://www.dropbox.com/scl/fi/f89ngw0hzu78jp35j9hw3/upload-error.jpg?rlkey=xrw3yy20c7z7zpwnlvclsrbue&dl=0


@magicmarc Let me get back to you on this. It might be an mBlock bug or something. I’ll see if I can try it with my own mBot Neo today. :+1:


im gonna try it friday at my home system too.


@magicmarc Let me know how it goes. I’m waiting for an mBlock personnel that I know to respond…


im also going to try it on our chromeboxes tomorrow, i know the chromebox mblock talks to the older mbots properly, as i used them last semester (because i couldnt figure out the line follower on the new mbot2!), so i was using my old mbots for the 3 (of 3 projects) the line follower, remote control and obstacle avoidance… but with new one, i find i harder to do the line follow , i havent figured it out yet.


its friday, i just tried to upload at home on my home pc, i used the v5.4 windows program, and program uploaded quickly and remoteworked… so its something o n my classroom windows laptop, ill try reinstlaling the program, latest… as well as make sure it connected, etc…
thanks as always!