Wheel IDE

Online demo »

Spike

This file contains procedures to communicate with Spike devices

Constants

The Spike module.
Source: lib/modules/spike.whl, line: 10
MODULE_SPIKE14

The Spike output ports.
Source: lib/modules/spike.whl, line: 13
SPIKE_OUTPUT_A0
SPIKE_OUTPUT_B1
SPIKE_OUTPUT_C2
SPIKE_OUTPUT_D3
SPIKE_OUTPUT_E4
SPIKE_OUTPUT_F5

The Spike input ports.
Source: lib/modules/spike.whl, line: 21
SPIKE_PORT_A0
SPIKE_PORT_B1
SPIKE_PORT_C2
SPIKE_PORT_D3
SPIKE_PORT_E4
SPIKE_PORT_F5

Module calls for spike functions.
Source: lib/modules/spike.whl, line: 29
SPIKE_LAYER_START0
SPIKE_LAYER_CLEAR_LEDS1
SPIKE_LAYER_SET_LED2
SPIKE_LAYER_SET_TEXT3

Devive types.
Source: lib/modules/spike.whl, line: 35
SPIKE_DEVICE_MEDIUM_MOTOR1
SPIKE_DEVICE_LARGE_MOTOR2

Records

SpikeVector
Source: lib/modules/spike.whl, line: 39
A record to contain vector data for acceleration and tilt values.

SpikeStatus
Source: lib/modules/spike.whl, line: 44
A record for button, tilt and acceleration status data.
NameType
x number
y number
z number

SpikeDevices
Source: lib/modules/spike.whl, line: 56
The status of the Spike device for all layers.
NameType Description
button number The device button value.
gyro SpikeVector The gyro vector.
accel SpikeVector The acceleration vector.
pos SpikeVector The position vector.

Variables

spikeDevices
Source: lib/modules/spike.whl, line: 71
Spike device status data.
NameType Array size Description
layer[4] SpikeStatus 4 Spike status data for all four layers.
union
layer1 SpikeStatus Spike status data for layer one.
layer2 SpikeStatus Spike status data for layer two.
layer3 SpikeStatus Spike status data for layer three.
layer4 SpikeStatus Spike status data for layer four.
Type
SpikeDevices

Procedures

spikeLayerStart
Source: lib/modules/spike.whl, line: 74

Start reading updates from the Spike devices.

proc spikeLayerStart()

spikeLayerClearLeds
Source: lib/modules/spike.whl, line: 80

Set the brightness of a led in the matrix.

proc spikeLayerClearLeds(number layer)
Parameters:
NameTypeDescription
layernumberThe layer.

spikeLayerSetLed
Source: lib/modules/spike.whl, line: 87

Set the brightness of a led in the matrix.

proc spikeLayerSetLed(number layer, number x, number y, number brightness)
Parameters:
NameTypeDescription
layernumberThe layer.
xnumberThe column.
ynumberThe row.
brightnessnumberThe let brightness.

spikeLayerSetText
Source: lib/modules/spike.whl, line: 97

Show a text on the led matrix.

proc spikeLayerSetText(number layer, string text)
Parameters:
NameTypeDescription
layernumber
textstringThe text.