This example shows how to use the Powered Up led lights.
The led lights can be controlled with the motor commands, motorOn turns the light
on, motorStop turns the light off.
"Powered Up Leds light example" "lib/modules/standard.whl" "lib/modules/device.whl" "lib/modules/poweredUp.whl" "lib/modules/motor.whl" proc main() ; Select the Powered Up device in the IDE... selectDevice(DEVICE_POWERED_UP) ; Select the Hub device: poweredUpSetDevice(LAYER_1, POWERED_UP_HUB) ; Select the Hub device: motorLayerSetType(LAYER_1, OUTPUT_A, POWERED_UP_DEVICE_LED_LIGHTS) motorSetSpeed(OUTPUT_A, 100) repeat ; You can turn the light on with the motor command: motorOn(OUTPUT_A) sleep(500) ; You can turn the light off with the motor command: motorStop(OUTPUT_A) sleep(500) end end