BlocosIA Wiki Editor

LEGO SPIKE Prime

Motors, color, distance and force sensors, hub lights and sound.

Use the hub with the SPIKE 3 app firmware. Close the SPIKE app and plug in the USB cable.

To use it: in the editor, click "Extensions" (bottom corner) and add "LEGO SPIKE Prime".

Stack

motor [A] run at ( ) % speed

Does an action. Snap it below another block.

Stack

motor [A] run ( ) degrees at ( ) % speed

Does an action. Snap it below another block.

Stack

stop motor [A]

Does an action. Snap it below another block.

Stack

write ( ) on hub light

Does an action. Snap it below another block.

Stack

show image [happy] on hub

Does an action. Snap it below another block.

Stack

turn off hub lights

Does an action. Snap it below another block.

Stack

beep ( ) Hz for ( ) secs

Does an action. Snap it below another block.

Hat

when force sensor [A] pressed

Starts a script when this happens.

Hat

when color sensor [A] sees [black]

Starts a script when this happens.

Reporter

color of sensor [A]

Gives a number or text. Put it inside a round slot.

Reporter

reflected light of sensor [A] (%)

Gives a number or text. Put it inside a round slot.

Reporter

distance of sensor [A] (cm)

Gives a number or text. Put it inside a round slot.

Reporter

force on sensor [A] (N)

Gives a number or text. Put it inside a round slot.

Boolean

force sensor [A] pressed?

Answers true or false. Use it in "if", "repeat until" and "wait until".

Reporter

position of motor [A] (degrees)

Gives a number or text. Put it inside a round slot.

Reporter

hub tilt: [yaw]

Gives a number or text. Put it inside a round slot.

Boolean

hub button [left] pressed?

Answers true or false. Use it in "if", "repeat until" and "wait until".