I am trying to write mBlock 5.5.1 code to control mBot Mega wheel motion using a joystick on a connected Makeblock Bluetooth Remote Controller. Does anyone have some example code that works for this purpose?
mBlock code for mBot Mega Joystick Control
I have a basic RC car control for the mbot ranger, it is on the forum, but the controls are the same.
Hi @GrampyBot, you can see how to use the Bluetooth Remote extension here:
Just apply the concepts there (read until the end) to the mBot Mega.
Best_codes:
It took a little playing around to get it all working as there are four motors and different Motion/Motor blocks for mBot Mega. But got it all to work - it can even do the “electric slide” on command! Turns out there is some good guidance on Makeblock Support - mBot Mega.
Thanks for your reply and support.
Got a mega and the bluetooth controller for my son’s Christmas gift.
Can’t attach the actual mcode file, so here’s a screencap of my progress that mostly works.
Alkaline batteries cause occasional hangs, press 2 to get it’s attention again. Li-ion work flawlessly.
Press 1 to stop if it’s running away from you, or pick it up if it won’t listen.
Pay close attention to the negated values or it will drive crazy.
When I said “mostly works” I was talking about the motor load killing the bluetooth responsiveness when using alkaline batteries.
Also, that it feels out of control when using the d-pad lateral motion because it doesn’t stop when the d-pad buttons are released. It shouldn’t keep going if no buttons are still being pressed, but there are no ‘button released’ events to hook into yet. (Haven’t investigated extending mBlock to expose those events.)