CRITICAL HARDWARE CHECK: USB 5V powers logic only. Plug in the 9V DC adapter (or insert 6x AA batteries) and slide the power switch to ON to deliver voltage to the motor ports.
K'NEX Control Box is an official USB HID device
Selects byte framing inside 64b report
80 ms
Virtual K'NEX Brick
Simulation only; does not change connected hardware.NO HW REQ
Direct Motor Controller Matrix
Outputs A, B, C, D (2-Pin Reversible K'NEX Gearhead Motors)
A
PORT A
CONNECTED
STOPPED (0%)
SPEED / POWER:0%
0%25%50%75%100%
B
PORT B
NO MOTOR
STOPPED (0%)
SPEED / POWER:0%
0%25%50%75%100%
C
PORT C
NO MOTOR
STOPPED (0%)
SPEED / POWER:0%
0%25%50%75%100%
D
PORT D
NO MOTOR
STOPPED (0%)
SPEED / POWER:0%
0%25%50%75%100%
Direct Rotation Request
Shows the requested target, not rotations remaining. The controller does not report live encoder counts.
No rotation target sent.
DRIVER IC:L298P DUAL H-BRIDGE (x2)
Quick Motion Sequencer
RAPID HARDWARE VERIFICATION
Live Sensor Telemetry
Inputs 1 to 6 accept different sensor types on any port; Port 7 is onboard sound.
1
PORT 1NO SENSOR
DISCONNECTEDRAW: 0
2
PORT 2NO SENSOR
DISCONNECTEDRAW: 0
3
PORT 3NO SENSOR
DISCONNECTEDRAW: 0
4
PORT 4NO SENSOR
DISCONNECTEDRAW: 0
5
PORT 5
NO SENSOR
DISCONNECTEDRAW: 0
6
PORT 6
NO SENSOR
DETECTING...
WAITING TELEMETRY...HUE: --°
CHIP 1 (LIGHT):0%
CHIP 2 (LIGHT):0%
DIFFERENCE (Δ):0%
7
PORT 7 (ONBOARD)SOUND LEVEL
0% SOUNDRAW: 26048
REALTIME OSCILLOSCOPE: ULTRASONIC DISTANCE (cm)-- cm
MAX: 250 cmMIN: 3 cm
Live Serial Monitor
// Web Serial subsystem initialized.
// Ready to connect to K'NEX Educational Control Brick.
// Press "CONNECT CONTROLLER" or enable "Virtual K'NEX Brick" to simulate.
K'NEX FLOW STUDIO 2.0 // PROGRAM WORKBENCH
Unified Block, Text (KinexBasic), SFC & In-Flight Telemetry IDE
Keep robot clear before running. E-STOP: Space
Local package inspection
Safety & slot upload constraints
Uploading stages code to controller slot memory without auto-starting. Verify connected motors before execution.
Connect controller before flashing.
PIC16F1527 RESOURCES:RAM: 0/16Threads: 1/16Flash: 136/16384 B (0.8%)Audio: 0.0/128.0 KB
1
KinexBasic language reference and examples
Drivetrain navigation commands: drive forward 20 cm (or mm, inches; optional at speed), turn right 90 deg (or left; optional at speed). Audio & musical notes: play note C4 for 0.5, play synth laser (retro effects: lion_roar, jump, laser, coin, alarm, siren, robot_chirp, powerup, explosion), tone 440 for 0.5, or play melody "star_wars" (available melodies: lion_fanfare, lion_roar, fanfare, star_wars, imperial_march, tetris, mario, pacman, beethoven, siren, charge, oiia_oiia, zelda_secret, megalovania, pink_panther, happy_birthday, axel_f).
Declare fixed-size arrays at the top level, for example array scores[3]; assign and read elements with constant indices such as set scores[0] = 10. Sizes and indices must be compile-time whole numbers; indices start at zero, elements must be assigned before use, and arrays share the 64 native scalar slots. The compiler reserves names v–z; arrays may use those slots, so do not use an aliased name as a separate scalar variable. Runtime indexing is unsupported. Assign runtime numbers with set speed = 30; use arithmetic such as speed * 2 in motor speeds, waits, and conditions. Start two ports together with motors A forward 80 and D reverse 80; add for 1.5 rotations to stop both after the same rotation count. Choose two different ports. Continuous coordinated commands require a later stop; rotation commands run only in uploaded native programs. Numeric conditions whose values are known before upload are selected at compile time; conditions using values changed by runtime branches execute on the controller. Combine comparisons with and, or, and not, and use parentheses to group them; not binds before and, which binds before or. Runtime conditions short-circuit from left to right. For a live sensor reading, use if distance(1) < speed:; thresholds and live distance output values use calibrated millimetres and require a connected ultrasonic sensor on that input. The Blockly live distance output requires fresh telemetry; generic sensor-value outputs are not supported by the official uploader. Indent each branch by four spaces. Variables first assigned inside a runtime branch must be initialized earlier or assigned in both branches. A bounded runtime loop can use while count > 0 max 10:; its condition is checked before each iteration, and the maximum is 1–100. Initialize variables before the loop. All motors are stopped on normal loop exit, but the iteration cap is not a wall-clock timeout or a guarantee against a stalled controller. Stop every motor with stop or stop all, or just one with stop motor A. Show constant or compile-time values on the controller LCD with display line 1 "Speed: {speed}%"; display lines are 1–4 and accept at most 120 characters. Use display clear to clear the screen. For loops use for 3 times: with a body indented four spaces; counted loops are expanded before upload. LCD commands require Compile and Upload.
BASIC-style blocks ignore indentation: For 3 Times … EndFor, or numeric For index = 1 To 5 Step 2 … EndFor (inclusive bounds; compile-time expansion, at most 100 iterations), If distance(1) < 100 Then … optional ElseIf condition Then branches … optional Else … EndIf, While condition Max 10 … EndWhile, or Repeat Until condition Max 10 … EndRepeat. You can also declare immutable numeric constants with Const LIMIT = 80; declare them before use. Numeric Switch state / Case 1, 3, 5 / Case 10 To 20 / Default / EndSwitch selects one branch with no fall-through; a Case may combine comma-separated numeric values and inclusive ascending ranges. Selectors may be runtime expressions, and overlapping Case values or ranges are rejected. Wait Until button(1) == 1 Max 20 checks the condition at up to 20 iterations, waiting 0.1 seconds between checks; the maximum is an iteration cap, not a time guarantee. Like other bounded while loops, it stops all motors when it exits. These forms use existing compiler constructs; do not mix explicit terminators with colon-and-indentation blocks.
Interactive SFC State Machine Simulation & Stepper: IEC 61131-3 Sequential Function Chart simulator. Step token progression visualizes active steps, transitions, and concurrent threads. Click any transition condition to toggle forced triggers ([FORCED]) or click a step to navigate manually.
State Machine Simulator:
● READYStep #0
Motors A / BA: STOP | B: STOP
Motors C / DC: STOP | D: STOP
LCD Virtual Display—
Audio / SoundSilent
Active Thread Program Counters (Packet 3)
Waiting for telemetry