Wheel IDE

Online demo »

Component/PUDevice

Namespace
components.puDevice

Constants

The button component module.
Source: lib/modules/components/poweredUpDevice.whl, line: 8
MODULE_COMPONENT_PU_DEVICE128

Module calls for button component functions.
Source: lib/modules/components/poweredUpDevice.whl, line: 11
PU_DEVICE_COMPONENT_SET_TYPE0
PU_DEVICE_COMPONENT_SET_PORT1
PU_DEVICE_COMPONENT_SET_SPEED2
PU_DEVICE_COMPONENT_SET_VALUE3
PU_DEVICE_COMPONENT_SET_READY4
PU_DEVICE_COMPONENT_SET_COLOR_MODE5

Properties

These properties can be edited with the property editor in the IDE.

NameTypeDescription
namestringThe component name.
xnumberThe left position of the component inside the parent component.
ynumberThe top position of the component inside the parent component.
zIndexnumberThe depth of the component related to other components in the parent.
portlistA list of selectable ports, options are: 1, 2, 3 or 4.
devicelistA list of sensor types, options are: Basic motor, Train motor, Led lights, Tacho motor, Move hub motor, Ctrl+ L motor, Ctrl+ XL motor or Distance sensor.
colorModebooleanIf this option is selected and the input type is Distance sensor then the value will be displayed as a color instead of a text.

Procedures

setType
Source: lib/modules/components/poweredUpDevice.whl, line: 28

Set the type of device.

proc setType(number windowHandle, number componentHandle, number type)
Parameters:
NameTypeDescription
windowHandlenumberThe handle of the window.
componentHandlenumberThe handle of the component.
typenumberThe device type.

setPort
Source: lib/modules/components/poweredUpDevice.whl, line: 37

Set the port of the device.

proc setPort(number windowHandle, number componentHandle, number port)
Parameters:
NameTypeDescription
windowHandlenumberThe handle of the window.
componentHandlenumberThe handle of the component.
portnumberThe device port.

setSpeed
Source: lib/modules/components/poweredUpDevice.whl, line: 46

Set the speed bar value.

proc setSpeed(number windowHandle, number componentHandle, number speed)
Parameters:
NameTypeDescription
windowHandlenumberThe handle of the window.
componentHandlenumberThe handle of the component.
speednumberThe speed value in the range of -100..100.

setValue
Source: lib/modules/components/poweredUpDevice.whl, line: 55

Set the value.

proc setValue(number windowHandle, number componentHandle, number value)
Parameters:
NameTypeDescription
windowHandlenumberThe handle of the window.
componentHandlenumberThe handle of the component.
valuenumberThe value.

setReady
Source: lib/modules/components/poweredUpDevice.whl, line: 64

Set the ready state.

proc setReady(number windowHandle, number componentHandle, number ready)
Parameters:
NameTypeDescription
windowHandlenumberThe handle of the window.
componentHandlenumberThe handle of the component.
readynumberThe ready state.

setColorMode
Source: lib/modules/components/poweredUpDevice.whl, line: 73

Set color mode, show the value as a color.

proc setColorMode(number windowHandle, number componentHandle, number colorMode)
Parameters:
NameTypeDescription
windowHandlenumberThe handle of the window.
componentHandlenumberThe handle of the component.
colorModenumberThe color display mode TRUE or FALSE.