APIΒΆ

color

The color module contains the color constants to use with the color_matrix, color_sensor and light modules.

color_sensor

The color_sensor module contains functions to interact with an attached Color Sensor (e.g. LEGO part 45605) and write code that reacts to specific colors or the intensity of the reflected light.

color_matrix

The color_matrix module contains functions to interact with an attached 3x3 Color Light Matrix (e.g. LEGO part 45608).

device

The device module contains functions to get general information about any devices plugged into the hub (motors, sensors, displays, etc).

distance_sensor

The distance_sensor module contains functions to interact with an attached Distance Sensor (e.g. LEGO part 45604) and write code that reacts to specific distances or lights up the device LEDs in different ways.

force_sensor

The force_sensor module contains functions to interact with an attached Force Sensor (e.g. LEGO part 45606) and enables you to write code that reacts to touch events or force magnitude.

hub

The hub package is home to all of the modules used to interact with various integrated inputs (gyroscope, buttons) and outputs (lights, sound) on a Spike Hub (e.g. LEGO parts 45601 or 45609).

hub.button

The button module includes functions to interact with the buttons on the Spike hub.

hub.light

The light module includes functions to change the color of the button lights on the SPIKE Prime hub.

hub.light_matrix

The light_matrix module includes functions to interact with the 5x5 LED matrix on the face of the SPIKE hubs.

hub.motion_sensor

The motion_sensor module includes functions to interact with the internal motion sensor (gyroscope) in a SPIKE hub.

hub.port

The port module contains constants that enable easy addressing of the lettered ports on the SPIKE Prime hub.

hub.sound

The sound module includes functions to play sounds from the Spike hub speaker.

motor

The motor module contains functions to control and query individual motors attached to the Spike hub.

motor_pair

The motor_pair module is used to run motors in a synchronized fashion.

orientation

The orientation module contains the orientation constants to use with the light_matrix module.

runloop

The runloop module contains all functions and constants to use the Runloop for asynchronous IO programming.