中文 →
12 cube kinds · one use case each
2026-09-07 · every item was read out of the real driver source code, not made up
Updated 2026-09-19: the real-board status of each cube now follows the cube hardware line
(cube-line overview 09-15 · motor board page 09-17 · camera firmware page 09-16)
Based on: the batch of MicroPython drivers you sent over WeChat (10 files) + 3 pulled directly off the board
(MPU6050_buzzer.py etc., not in the zip) + the usage-notes PDF.
Board tested: MicroPython v1.26.1 / ESP32_GENERIC.
How to read the status (cube-line terms, since 09-19): proven on a real board = code generated from Blockly ran on a real board, with measurements;
runs on its own board = works on a dedicated board / its own firmware, not yet wired into the Blockly export;
stub = the original program exists, not measured, not integrated.
Inputs (blue)
Distancedistance · HC-SR04
IN
Statusproven on a real board
5 reads in a row at 70.1cm = 70.1 / 70.0 / 70.1 / 69.6 / 70.1, spread 0.5cm (±0.7%).
Measured again over WiFi on 09-09: 20 of 20 samples valid, median 260.39cm, spread 0.10%; moved to an empty pin, all 8 timed out (negative control).
Same blocks with only the threshold changed: 300cm → buzzer sounds, 10cm → silent
ReadingTRIG sends a 10µs pulse → measure how long ECHO stays high
→ distance = pulse width × 0.034 ÷ 2 (cm)
RangeHard-coded in the driver as 2 ≤ d ≤ 400 cm; outside that it returns None.
★ The usage notes say 2–600cm, which disagrees with the code — the code wins
Use case: stop and alarm when too close — under 6cm (the driver's default threshold) the buzzer sounds and the OLED shows the distance.
This is the one running in your photo.
Temp & humiditytemp · DHT11
IN
Statusstub original program exists (DHT11.py), not measured, not integrated
ReadingSingle-wire bus, MicroPython's built-in dht module:
measure() → temperature() ℃ / humidity() %
QuirksAt most one sample per second; faster and it reads nothing. Holding it in your palm or breathing on it makes the values rise
Use case: above 30℃ turn on a fan (motor), below 28℃ stop — a 2℃ dead band to avoid chatter.
Tilttilt · MPU6050
IN
Statusstub original programs exist (MPU6050_buzzer.py / MPU6050_num_graph.py), not measured, not integrated.
★ This driver wasn't in the zip; I pulled it off the board
ReadingI2C address 0x68. Acceleration ÷16384 = g,
gyro ÷131 = °/s; pitch/roll come from atan2
ThresholdDriver default: alarm when the angle exceeds 20° or motion exceeds 5
Use case: stop if it tips over — when pitch or roll exceeds 20°, release all motors at once and sound the alarm.
This one is also a safety feature.
Water levelwater · analog
IN
Statusstub original program exists (water_sensor.py), not measured, not integrated
Reading12-bit ADC. 1500 (in air) → 4000 (fully submerged),
mapped linearly to 0–100%
Quirks★ Usage notes, verbatim: lower it into water slowly, or the value swings quickly;
when you take it out, water clings to it, so the value drops slowly — that is its own hysteresis, not a fault
Use case: alarm when dry — below 10% (driver default) the buzzer sounds.
Soundsound · microphone
IN
Statusstub original programs exist (audio_view.py and a microphone script), not measured, not integrated
Reading10 ADC samples in a row, averaged (total // 10) to suppress noise
QuirksUsage notes: get closer or make it louder; tapping it lightly with a finger works best
Use case: clap once to move forward, clap again to stop.
Magnetic switchreed · reed switch
IN
Statusstub original program exists (reed_switch_buzzer.py), not measured, not integrated
ReadingGPIO internal pull-up. 0 = closed (magnet present),
1 = open (no magnet)
★ It's inverted — the easiest one to get wrong
Use case: alarm when a door/lid opens — the magnet moves away, it reads 1, the buzzer sounds.
Cameracam
IN
Statusruns on its own board
★ ESP32-CAM is a separate firmware on a separate board; it won't run together with the programs here.
Live view to a screen works (through a PC relay, 4.5 FPS); held back by power supply, can't run continuously yet
Boards09-16: of five ESP32-CAM boards, four are flashed with MicroPython v1.27 + mpy_cam;
two fully usable, two with broken camera modules, one not flashed yet
Use case: a separate CAM board; images go out over WiFi through a PC relay. Not yet in the Blockly export.
Outputs (red)
Motormotor · tacho_motor
OUT
Statusruns on its own board
A separate motor board (ESP32 + DRV8833, C module, with encoder). Both motor boards run tacho_c_v6.3_joint:
no-load positioning measured, stop error 0.1 count on average, 0.17° max. No-load data only; not yet in the Blockly export
Pins4 GPIOs per port, 16 for all 4 ports
★ At first I thought it used no general GPIOs — wrong; it competes with sensors for pins
Safety★ Port 3's GPIO14 is high for a moment at power-up, so a motor plugged in there twitches or turns a bit;
software can't cover it. The fix is a 10 kΩ pull-down from GPIO14 to ground; until then, don't put a joint that can be damaged on port 3
Use case: drive forward / turn / stop at a target.
Buzzerbuzzer
OUT
Statusproven on a real board
Measured 09-09: PWM on GPIO25, sounds at both 1200Hz and 1800Hz with duty 512; change only the threshold in the blocks and sound / no sound follows
WritingPassive buzzer, frequency set by PWM. A plain high level makes no sound — it must be PWM.
★ Usage notes: not recommended for long use
Use case: the sound for any "over the limit" — too close, out of water, tipped over.
Musictone
OUT
Statusstub original program exists (buzzer.py), not measured, not integrated.
★ Same physical part as the buzzer; a board can have only one (the part itself has sounded on a real board via the buzzer cube; the melody program hasn't been checked)
WritingPWM at each note's frequency:
Do=262 Re=294 Mi=330 Fa=349 Sol=392 La=440 Si=494
Use case: play "Twinkle Twinkle Little Star" when a task is done (the driver includes it).
RGB lightrgb
OUT
Statusstub original program exists (RGB.py), not measured, not integrated.
★ Don't use it while the ultrasonic sensor is plugged in: both need GPIO13, two outputs fight
WritingThree PWM channels. Give 0–255; internally ×4 becomes duty 0–1023.
The driver supports both common-cathode and common-anode wiring (one line, RGB_TYPE, switches)
Use case: redder the closer it gets — map the distance reading straight to the red channel,
so you can see how near it is without an alarm sound.
Screenscreen · SSD1306
OUT
Statusproven on a real board
Measured 09-09: I2C(1) SCL=27 SDA=14 @400kHz, scan finds 0x3C, drawing text works
WritingI2C, 128×64 monochrome.
★ Every cube that needs to display shares this one I2C bus — that's legitimate sharing, not a conflict
Use case: show the current reading directly — the most useful cube while debugging.
The honest summary (updated 09-19): of the 12 kinds, 3 are proven end-to-end from Blockly to a real board (distance, buzzer, screen),
2 run on their own boards (camera, motor; not yet in the Blockly export), and 7 are stubs — the original program exists, not measured, not integrated.
Don't mistake having a program for working.
★ "Plug and play" is not true: the original 12 programs assign 5 pins (25/32/12/13/34) to different parts.
In simulation, place cubes anywhere; on a real board, wire each one to the listed pins.
Next, fill them in one kind at a time: measure each on a board a few times with a negative control, record range/spread/quirks — only measured counts — and build a factory parameter table. Now at 3/12.
proven on a real board
runs on its own board
stub