This example shows how to control the built in light on the Powered Up device.
The demo below selects the Hub device in the simulator with the DEVICE_POWERED_UP constant.
If you have a different hub connected you should change the POWERED_UP_HUB to
POWERED_UP_MOVE_HUB, POWERED_UP_REMOTE_CONTROL or POWERED_UP_TECHNIC_HUB
depending on the type of device you are using.
"Powered Up Light example" "lib/modules/standard.whl" "lib/modules/device.whl" "lib/modules/light.whl" "Hub" proc main() ; Select the Powered Up device in the IDE... selectDevice(DEVICE_POWERED_UP) ; Select the Hub device: poweredUpSetDevice(LAYER_1, POWERED_UP_HUB) repeat light(LIGHT_PU_BLUE) sleep(1000) light(LIGHT_PU_GREEN) sleep(1000) light(LIGHT_PU_YELLOW) sleep(1000) light(LIGHT_PU_RED) sleep(1000) end end