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
The Powered Up output ports.
Source: lib/modules/poweredUp.whl, line: 13
| POWERED_UP_OUTPUT_A | 0 |
| POWERED_UP_OUTPUT_B | 1 |
| POWERED_UP_OUTPUT_C | 2 |
| POWERED_UP_OUTPUT_D | 3 |
The Powered Up input ports.
Source: lib/modules/poweredUp.whl, line: 19
| POWERED_UP_PORT_A | 0 |
| POWERED_UP_PORT_B | 1 |
| POWERED_UP_PORT_C | 2 |
| POWERED_UP_PORT_D | 3 |
Powered Up device types.
Source: lib/modules/poweredUp.whl, line: 25
| POWERED_UP_MOVE_HUB | 2 |
| POWERED_UP_HUB | 3 |
| POWERED_UP_REMOTE_CONTROL | 4 |
| POWERED_UP_TECHNIC_HUB | 6 |
Module calls for device functions.
Source: lib/modules/poweredUp.whl, line: 31
| POWERED_UP_START | 0 |
| POWERED_UP_SET_DEVICE | 1 |
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_MOTOR | 1 |
| POWERED_UP_DEVICE_TRAIN_MOTOR | 2 |
| POWERED_UP_DEVICE_LED_LIGHTS | 8 |
| POWERED_UP_DEVICE_BOOST_TACHO_MOTOR | 38 |
| POWERED_UP_DEVICE_BOOST_MOVE_HUB_MOTOR | 39 |
| POWERED_UP_DEVICE_CONTROL_PLUS_LARGE_MOTOR | 46 |
| POWERED_UP_DEVICE_CONTROL_PLUS_XLARGE_MOTOR | 47 |
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_DISTANCE | 37 |
The sensor modes for the color/distance sensor.
Source: lib/modules/poweredUp.whl, line: 47
| POWERED_UP_SENSOR_MODE_DISTANCE | 0 |
| POWERED_UP_SENSOR_MODE_COLOR | 1 |
Records
PoweredUpVector
Source: lib/modules/poweredUp.whl, line: 51
A record to contain vector data for acceleration and tilt values.
| Name | Type |
| x |
number |
| y |
number |
| z |
number |
PoweredUpStatus
Source: lib/modules/poweredUp.whl, line: 56
A record for button, tilt and acceleration status data.
| Name | Type |
Description |
| button |
number |
The device button value. |
| tilt |
PoweredUpVector |
The tilt vector. |
| accel |
PoweredUpVector |
The acceleration vector. |
PoweredUpDevices
Source: lib/modules/poweredUp.whl, line: 66
The status of the Powered Up device for all layers.
| Name | Type |
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. |
Variables
poweredUpDevices
Source: lib/modules/poweredUp.whl, line: 93
Powered Up device status data.
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:
| Name | Type | Description |
| layer | number | The layer. |
| device | number | The device type. |