Wheel IDE

Online demo »

PoweredUp

This file contains procedures to read built in sensors in Powered Up devices.

Constants

The Powered Up module.
Source: lib/modules/poweredUp.whl, line: 10
MODULE_POWERED_UP13

The Powered Up output ports.
Source: lib/modules/poweredUp.whl, line: 13
POWERED_UP_OUTPUT_A0
POWERED_UP_OUTPUT_B1
POWERED_UP_OUTPUT_C2
POWERED_UP_OUTPUT_D3

The Powered Up input ports.
Source: lib/modules/poweredUp.whl, line: 19
POWERED_UP_PORT_A0
POWERED_UP_PORT_B1
POWERED_UP_PORT_C2
POWERED_UP_PORT_D3

Powered Up device types.
Source: lib/modules/poweredUp.whl, line: 25
POWERED_UP_MOVE_HUB2
POWERED_UP_HUB3
POWERED_UP_REMOTE_CONTROL4
POWERED_UP_TECHNIC_HUB6

Module calls for device functions.
Source: lib/modules/poweredUp.whl, line: 31
POWERED_UP_START0
POWERED_UP_SET_DEVICE1

Motor types, these constants can be used as a parameter for the motorSetType or motorLayerSetType procedures.
Source: lib/modules/poweredUp.whl, line: 35
POWERED_UP_DEVICE_BASIC_MOTOR1
POWERED_UP_DEVICE_TRAIN_MOTOR2
POWERED_UP_DEVICE_LED_LIGHTS8
POWERED_UP_DEVICE_BOOST_TACHO_MOTOR38
POWERED_UP_DEVICE_BOOST_MOVE_HUB_MOTOR39
POWERED_UP_DEVICE_CONTROL_PLUS_LARGE_MOTOR46
POWERED_UP_DEVICE_CONTROL_PLUS_XLARGE_MOTOR47

Sensor types, these constants can be used as a parameter for the sensorSetType or sensorLayerSetType procedures.
Source: lib/modules/poweredUp.whl, line: 44
POWERED_UP_DEVICE_BOOST_DISTANCE37

The sensor modes for the color/distance sensor.
Source: lib/modules/poweredUp.whl, line: 47
POWERED_UP_SENSOR_MODE_DISTANCE0
POWERED_UP_SENSOR_MODE_COLOR1

Records

PoweredUpVector
Source: lib/modules/poweredUp.whl, line: 51
A record to contain vector data for acceleration and tilt values.

PoweredUpStatus
Source: lib/modules/poweredUp.whl, line: 56
A record for button, tilt and acceleration status data.
NameType
x number
y number
z number

PoweredUpDevices
Source: lib/modules/poweredUp.whl, line: 66
The status of the Powered Up device for all layers.
NameType Description
button number The device button value.
tilt PoweredUpVector The tilt vector.
accel PoweredUpVector The acceleration vector.

Variables

poweredUpDevices
Source: lib/modules/poweredUp.whl, line: 93
Powered Up device status data.
NameType Array size Description
layer[10] PoweredUpStatus 10 Powered Up status data for all layers.
union
layer1 PoweredUpStatus Powered Up status data for layer one.
layer2 PoweredUpStatus Powered Up status data for layer two.
layer3 PoweredUpStatus Powered Up status data for layer three.
layer4 PoweredUpStatus Powered Up status data for layer four.
layer5 PoweredUpStatus Powered Up status data for layer five.
layer6 PoweredUpStatus Powered Up status data for layer six.
layer7 PoweredUpStatus Powered Up status data for layer seven.
layer8 PoweredUpStatus Powered Up status data for layer eight.
layer9 PoweredUpStatus Powered Up status data for layer nine.
layer10 PoweredUpStatus Powered Up status data for layer ten.
Type
PoweredUpDevices

Procedures

poweredUpStart
Source: lib/modules/poweredUp.whl, line: 96

Start reading updates from the Powered Up devices.

proc poweredUpStart()

poweredUpSetDevice
Source: lib/modules/poweredUp.whl, line: 102

Select a Powered Up device, this function is only usefull for to simulate a device without a connection. When connecting an actual device this value will be overruled by the actual connected device type.

proc poweredUpSetDevice(number layer, number device)
Parameters:
NameTypeDescription
layernumberThe layer.
devicenumberThe device type.