STARLEAP / SPIKE PRIME PYTHON / 2026–27
Build 2026.09.22-090630-0400
On this page
Project 18: Choice Build Remix
You need: a LEGO SPIKE Prime set and the SPIKE App Python editor.
Goal
Choose a LEGO build, then program it with skills you already know.
This project is for pairs who are ready to make choices but still need a clear plan.
Choose A Build
Use the LEGO build menu or the SPIKE App building instructions.
Good choices:
- Weathercaster
- Wind Indicator
- Tomato-meter
- Game Master
- Quality Check Robot
- The Tracker
- CNC Machine
- Prosthesis
- Super-Safe-Deposit Box
- Advanced Driving Base with tools
Choose A Coding Skill
Pick one input:
- hub button
- hub tap
- force sensor
- distance sensor
- color sensor
Pick one output:
- motor movement
- motor pair driving
- light matrix image
- app sound
- hub beep
- printed score or sensor reading
Pick one structure:
- variable labels
- helper function
if/elif/elseforloopwhile True
Step 1: Prove One Input Works
Start with the smallest input test.
Example for a force sensor:
from hub import port
import runloop
import force_sensor
force_port = port.D
def is_pressed():
return force_sensor.pressed(force_port)
async def main():
await runloop.until(is_pressed)
print("pressed")
runloop.run(main())
Run the program.
Observe: Your input should print a message.
Step 2: Prove One Output Works
Example for one motor:
from hub import port
import runloop
import motor
motor_port = port.A
async def main():
await motor.run_for_degrees(motor_port, 180, 300)
runloop.run(main())
Run the program.
Observe: Your output should move, show, beep, or print.
Step 3: Combine Input And Output
Use this shape:
from hub import port
import runloop
import force_sensor
import motor
force_port = port.D
motor_port = port.A
def is_pressed():
return force_sensor.pressed(force_port)
async def main():
await runloop.until(is_pressed)
await motor.run_for_degrees(motor_port, 180, 300)
runloop.run(main())
Run the program.
Observe: The input should trigger the output.
Physical Challenge
Make your build do one real job:
- point to a category
- open or close a door
- sort one object
- move to a target
- warn before getting too close
- score a point
- push or lift an object
Levels:
- Level 1: one input triggers one output
- Level 2: add a variable for the number you tune
- Level 3: add a helper function
- Level 4: run the behavior three times reliably
Extra setup idea: Choose any matching setup from the Challenge Setups sheet.
Teacher Check
Show your teacher:
- the LEGO build you chose
- the input test
- the output test
- the combined physical behavior
- one line you changed on purpose
Before You Put The Kit Away
Save your program. Stop the program before moving wires or changing the build. Show the teacher your working behavior, point to one changed line, and explain what it controls. Keep your place for next time.