he Makeblock robot is a low-priced kit that is easily assembled and that works well as designed. The default control sofware is effective but does not work for custom complex control sequences.
It is possible to replace the default firmware with one's own through B4R, Arduino IDE, or the mBot IDE (based on Scratch programming). However, I wanted to see how far I could get with using bluetooth commands from a android (or iOS) device using B4A or B4i.
The solution presented here uses the default firmware of the robot to perform the core actions, and uses Erel's "Arduino Bluetooth Example" to send commands through Bluetooth.
https://www.b4x.com/android/forum/threads/hc-05-classic-bluetooth.66677/#content
There are some minor changes to Erel's example and the addition of specific commands. Makeblock firmware commands can be found in the mBlock IDE, as shown in http://learn.makeblock.com/en/makeblock-orion-protocol/
You may also be interested in the files in the extension libraries (windows):
C:\Program Files (x86)\mBlock\ext\libraries\Arduino
C:\Program Files (x86)\mBlock\ext\libraries\mblock
The example action shown in the image is here:
It is possible to replace the default firmware with one's own through B4R, Arduino IDE, or the mBot IDE (based on Scratch programming). However, I wanted to see how far I could get with using bluetooth commands from a android (or iOS) device using B4A or B4i.
The solution presented here uses the default firmware of the robot to perform the core actions, and uses Erel's "Arduino Bluetooth Example" to send commands through Bluetooth.
https://www.b4x.com/android/forum/threads/hc-05-classic-bluetooth.66677/#content
There are some minor changes to Erel's example and the addition of specific commands. Makeblock firmware commands can be found in the mBlock IDE, as shown in http://learn.makeblock.com/en/makeblock-orion-protocol/
You may also be interested in the files in the extension libraries (windows):
C:\Program Files (x86)\mBlock\ext\libraries\Arduino
C:\Program Files (x86)\mBlock\ext\libraries\mblock
The example action shown in the image is here:
B4X:
Sub btnStart_Click()
mkLeftLight(Colors.Red): Wait For Command_Complete
mkRightLight(Colors.Red): Wait For Command_Complete
mkTone(notes.Get("C7"), 2000): Wait For Command_Complete
mkLeftLight(Colors.Green): Wait For Command_Complete
mkRightLight(Colors.Green): Wait For Command_Complete
mkMainServo(90): Wait For Command_Complete: Sleep(500)
mkMainServo(50): Wait For Command_Complete: Sleep(500)
mkMainServo(130): Wait For Command_Complete: Sleep(500)
mkMainServo(90): Wait For Command_Complete: Sleep(500)
mkForward(150): Wait For Command_Complete: Sleep(500)
mkTurnLeft(150): Wait For Command_Complete: Sleep(500)
mkBackward(150): Wait For Command_Complete: Sleep(500)
mkTurnRight(150): Wait For Command_Complete: Sleep(500)
mkStop: Wait For Command_Complete
mkTone(notes.Get("B1"), 2000): Wait For Command_Complete
End Sub
Sub Command()
CallSubDelayed(Me, "Command_Complete")
End Sub
Attachments
Last edited: