Robot mBot2: Difference between revisions
Jump to navigation
Jump to search
Created page with "== Required software == === mLink Controller === ==== Ubuntu ==== Driver: https://dl.makeblock.com/mblock5/linux/mLink-1.2.0-amd64.deb start it: sudo mblock-mlink start == Start programming == === Online IDE === https://ide.mblock.cc/ * CyberPi device should appear on the left side * Click on Switch to mLink * Click Connect none|thumb" |
No edit summary |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
== | == Installation == | ||
=== mLink Controller === | === mLink Controller === | ||
| Line 8: | Line 8: | ||
start it: sudo mblock-mlink start | start it: sudo mblock-mlink start | ||
== | === Connection via Wifi === | ||
* Before doing this step, you have to do the following step "Setup editor & Device" | |||
* After that, in the editor, switch to "Upload" mode instead of "Live" in the left panel. Switch the editor to "Python" execute this script.<syntaxhighlight lang="python"> | |||
import cyberpi as cpi | |||
import time | |||
cpi.console.clear() | |||
try: | |||
# Line 8 is here: | |||
cpi.network.config_sta("SSID_NAME", "PASSWORD") | |||
cpi.console.println("Connecting...") | |||
except Exception as e: | |||
cpi.console.println("Error details:") | |||
cpi.console.println(str(e)) | |||
while not cpi.network.is_connect(): | |||
time.sleep(0.1) | |||
cpi.console.println("Success!") | |||
</syntaxhighlight> | |||
== Setup editor & Device == | |||
=== Online IDE === | === Online IDE === | ||
https://ide.mblock.cc/ | https://ide.mblock.cc/ | ||
* | * Connect the mbot2 via usb | ||
* Click on Switch to mLink | * Add a new device "mBot2" using the button the left side | ||
* Click on Switch to mLink (in the image it shows "direct connection") | |||
* Click Connect | * Click Connect | ||
[[File:Mbot2.png|none|thumb]] | [[File:Mbot2.png|none|thumb]] | ||
=== Update Firmware === | |||
Having selected mbot2, click on settings and Firmware Update to make sure you have the latest version | |||
== Basic example == | |||
On the side panel, you can select the different events and actions we want to make. In this example, we use: | |||
* Event: when jostick is pulled up | |||
* Display: clear screen | |||
* Display: print message | |||
* LED: play animation | |||
* Audio: play hi | |||
* mBot2 Chassis: move forward 1 cm | |||
[[File:Mblock sample.png|none|thumb]] | |||
[[Category:IT Robotics]] | |||
Latest revision as of 12:44, 18 March 2026
Installation
mLink Controller
Ubuntu
Driver: https://dl.makeblock.com/mblock5/linux/mLink-1.2.0-amd64.deb
start it: sudo mblock-mlink start
Connection via Wifi
- Before doing this step, you have to do the following step "Setup editor & Device"
- After that, in the editor, switch to "Upload" mode instead of "Live" in the left panel. Switch the editor to "Python" execute this script.
import cyberpi as cpi import time cpi.console.clear() try: # Line 8 is here: cpi.network.config_sta("SSID_NAME", "PASSWORD") cpi.console.println("Connecting...") except Exception as e: cpi.console.println("Error details:") cpi.console.println(str(e)) while not cpi.network.is_connect(): time.sleep(0.1) cpi.console.println("Success!")
Setup editor & Device
Online IDE
- Connect the mbot2 via usb
- Add a new device "mBot2" using the button the left side
- Click on Switch to mLink (in the image it shows "direct connection")
- Click Connect

Update Firmware
Having selected mbot2, click on settings and Firmware Update to make sure you have the latest version
Basic example
On the side panel, you can select the different events and actions we want to make. In this example, we use:
- Event: when jostick is pulled up
- Display: clear screen
- Display: print message
- LED: play animation
- Audio: play hi
- mBot2 Chassis: move forward 1 cm
