Web Bluetooth is unsupported or restricted here.To pair, please use Chrome (Android/Desktop) or Bluefy (iOS) over HTTPS or localhost.
STEM Smart LabsBluetooth Controller Hub
Offline
Control Board
Drive with keys:▲▼◀▶orWASD(Stop: SPACE)
Steer X: 0
Drive Y: 0
Action Switches
Actuators (Servo)
Servo Angle S190°
Servo Angle S290°
Steer (Roll): 0
Speed (Pitch): 0
Activity:OFFLINE
Setup & Programming Guide
Follow these steps to connect and control your micro:bit robot using STEM Smart Labs Controller:
Ensure your micro:bit is powered on and Bluetooth is enabled on your computer or phone.
Flash your micro:bit with a program that listens for UART serial data over Bluetooth. See the templates below.
Click the Pair Micro:bit button in the top bar to scan and connect!
MakeCode (Blocks) Programming
In Microsoft MakeCode, configure the following block setup:
Open MakeCode, click Extensions, and search/add bluetooth.
In on start, insert the bluetooth uart service block.
Create a on bluetooth connected block to display a checkbox.
Create a on bluetooth disconnected block to display a cross.
Create a on rx line received event block. In it, read the line value, clean it, and write conditional statements (e.g. if line == "UP" then driveForward() and if line == "up" then stop()).
MicroPython Programming (V2)
# Copy & flash onto micro:bit V2
from microbit import *
import bluetooth
# Setup Bluetooth UART service
uart = bluetooth.Uart()
uart.start()
display.show(Image.ASLEEP)
while True:
if uart.is_connected():
display.show(Image.YES)
# Check for incoming commands
if uart.any():
data = uart.readline().decode('utf-8').strip()
# Simple D-Pad actions
if data == "UP":
# Drive motors forward
pass
elif data == "DOWN":
# Drive motors backward
pass
elif data == "LEFT":
# Spin left
pass
elif data == "RIGHT":
# Spin right
pass
elif data in ["up", "down", "left", "right"]:
# Stop motors
pass
# Action Buttons
elif data == "A":
# Button A pressed
pass
elif data == "a":
# Button A released
pass
# Slider 1/C (parse "c180" -> 180)
elif data.startswith("c"):
try:
servo_val = int(data[1:])
# Set servo 1 angle to servo_val
except:
pass
# Slider 2/X (parse "x180" -> 180)
elif data.startswith("x"):
try:
servo_val = int(data[1:])
# Set servo 2 angle to servo_val
except:
pass
# Joystick actions (parse "X+45,Y-90")
elif data.startswith("X") and ",Y" in data:
try:
parts = data.split(',')
joyX = int(parts[0][1:])
joyY = int(parts[1][2:])
# Map joyX and joyY to motor speeds
except:
pass
else:
display.show(Image.NO)
sleep(200)