Important update – In June 2023 LEGO decided to update the Powered Up app with a new code block design, and in July they provided their own block guide that is accessible here. Their page has the most frequent blocks described, and you can find a link on that page with a pdf that has all the new blocks. The guide below is useable with the 3.x.x version of the app.
This is the full code block guide for the LEGO® Powered Up app.
Latest update: 04/29/2020
App version used: 3.1.1
Usage
This is the extended version of the code block guide. Click here for the simple version with an easy navigation interface.
In this version you have the following options:
– filter columns – use the Column visibility button to toggle the columns
– search – use the search text box to filter for any expression (e.g. block category)
– change the number of rows – use the Show x entries drop down to change the rows displayed. Only advised to increase on a touch screen interface where the table can be scrolled horizontally without the slider on the bottom.
Glossary
Simple motor – a Powered Up motor that only has power regulation, like the 45303 Simple Medium Linear Motor
Tacho motor – a Powered Up motor that has an internal encoder and has speed and position regulation like the 88008 Medium Linear Motor or the L / XL motors.
Slider interface – one of the controller interfaces in the Free Code area of the Powered Up app with 2 sliders and 3 buttons
Race Car interface – one of the controller intarfaces in the Free Code area of the Powered Up app with 1 joystick and 4 buttons
Composite Block – a block that contains one or more program sequences
Disclaimer – This guide is partially based on a document received from LEGO® Customer Service, additional information and examples were added based on the Powered Up app and my experience.
Block Image | Block Category | Block SubCategory | Block Name | Description (official / my notes) | easy | medium | hard | App version | Example | Example (code) | Notes |
---|---|---|---|---|---|---|---|---|---|---|---|
Flow Blocks | Start | Starts the execution of the attached sequence when the block is clicked or when the program starts. | x | x | x | 2.1.0+ | Starts the sequence that sets the motor power on port A to 50 | ||||
Flow Blocks | StartOnTrue | Starts the execution of the attached sequence when the condition is true. | x | x | 2.1.0+ | If Slider 1's position is not 0 then sets the light intensity on port D to 100% | |||||
Flow Blocks | StartOnEdge | Starts the execution of the attached sequence when the condition switches from false to true. | x | 2.1.0+ | If Slider 1's position is changed from 0 then play the car start sound | ||||||
Flow Blocks | EventStart | Starts the execution of the attached sequence when the flag number is triggered. | x | x | 2.1.0+ | The Start sequence begins first, sets the light intensity on port D to 100% then triggers the "Flag 1" sequence that sets the motor power on port A to 50. | |||||
Flow Blocks | EventTrigger | Triggers flag number. | x | x | 2.1.0+ | The Start sequence begins first, sets the light intensity on port D to 100% then triggers the "Flag 1" sequence that sets the motor power on port A to 50. | |||||
Flow Blocks | WaitForTime | Wait for time (in seconds). | x | x | x | 2.1.0+ | After the sequence is started the timer waits for 2 seconds before setting the motor power on port A to 50 | ||||
Flow Blocks | WaitForTrue | Wait for the condition to become true. | x | x | 2.1.0+ | The sequence sets the light intensity on port D to 0%, then waits for the slider to be moved, once it is moved it plays the car start sound | |||||
Flow Blocks | CountLoop | Loop enclosed sequence for number of times. | x | x | x | 2.1.0+ | The Hub's LED light is set to red and then off 3 times - this makes the LED blink quickly in red 3 times | ||||
Flow Blocks | WhileLoop | Lopp enclosed sequence while condition is true. | x | x | 2.1.0+ | Plays the engine revving sound until the slider is moved | |||||
Flow Blocks | LoopForever | Loop enclosed sequence forever. | x | x | x | 2.1.0+ | The most frequently used and most important loop - required for every "square" that needs to run constantly. Here Slider 1 sets the speed of motor on port A, it needs to loop to adjust the speed constantly according to the position of the slider. | ||||
Flow Blocks | IfSwitch | If condition is true then execute top sequence, else execute bottom sequence. | x | x | 2.1.0+ | If the slider is below 50 then the LED on the hub is red, over 50 it turns green. Enclosed in a loop for constant monitoring of the slider position. | |||||
Flow Blocks | ForkJoin | Execute both sequences at the same time, and wait for both sequences to complete before executing next block. | x | x | 2.1.0+ | Motor A runs for 2 seconds, motor B runs for 5 seconds but the car sound is played only when both motors stop. | |||||
Flow Blocks | InterruptOthers | Stops all other program sequences and continues with execution of the attached sequence. | x | x | 2.1.0+ | Slider 1 controls the power of motor A, once the wheel button is pressed the slider stops working and the car brake sound is played. | |||||
Flow Blocks | End | Stops the execution of all sequences running on the current canvas. If used in the top most program, this will terminate the program. If used in a Model Block, then the Model Block is terminated, but the program containing the Model Block will continue execution. | x | x | 2.1.0+ | Wheel button acts as an emergency stop, once it is pressed all other sequences are stopped therefore the slider will stop controlling the speed of the motor. | |||||
Sensors | Boost Sensors | TriggerOnColor | Triggers when the color measured by the Sensor is equal to color. Boost Sensor only | x | x | x | 2.1.0+ | If the sensor attached to port C detects red then the sound is played | |||
Sensors | Boost Sensors | WaitForColor | Wait for the color measured by the Sensor to be equal to color. Boost sensor only | x | x | x | 2.1.0+ | The Hub's LED is turned off first, if the sensor attached to port C detects red then the Hub's LED is also switched to red | |||
Sensors | Boost Sensors | ColorSensor | Get current color measured by the Sensor. Boost sensor only | x | x | 2.1.0+ | The Hub's sensor is set to the color what the sensor attached to port C detects | ||||
Sensors | Boost Sensors | TriggerOnDistancelessThan | Triggers when the distance measured by the Sensor is less than distance. Boost sensor only | x | x | x | 2.1.0+ | If the sensor detects something at distance 5 then the sound is played | |||
Sensors | Boost Sensors | WaitForDistancelessThan | Wait for the distance measured by the Sensor to be less than distance. Boost sensor only. | x | x | x | 2.1.0+ | The Hub's LED is turned off first, if the sensor attached to port C detects something in distance '5' then the Hub's LED is also switched to red | |||
Sensors | Boost Sensors | VisionProximitySensor AddressablePort | Get current distance measured by the Sensor. Boost sensor only | x | x | 2.1.0+ | If something gets closer to the sensor than distance '5' then the sound is played | ||||
Sensors | Boost Sensors | VisionReflectionSensor AddressablePort | Get current ambient light level measured by the Sensor. Boost sensor only | x | x | 2.1.0+ | If the something covers the light sensor (value becomes greater than 2) then the sound is played | ||||
Sensors | Boost Sensors | TriggerOnOrientation | Triggers when the Hub Orientation is equal to Hub Orientation. Boost hub only | x | x | x | 2.1.0+ | If the Hub's orientation becomes horizontal then the Hub's LED color switched to red | |||
Sensors | Boost Sensors | WaitForOrientation | Wait for the Hub orientation to be equal to Hub orientation. Boost hub only | x | x | x | 2.1.0+ | If the Hub's orientation becomes horizontal then the Hub's LED color switched to red | |||
Sensors | Boost Sensors | DriveBaseTiltGetOrientation AddressablePort | Get current Hub orientation. Boost hub only | x | x | 2.1.0+ | The Hub's orientation is stored in variable "a" and can be used as an input in other sequences | ||||
Sensors | Boost Sensors | DriverbaseTiltGetAngleX AddressablePort | Get current Hub tilt angle on the X axis (-90 .90). Boost Hub only | x | x | 2.1.0+ | The Hub's tilt angle X is displayed on the slider controller screen | ||||
Sensors | Boost Sensors | DriverbaseTiltGetAngleY AddressablePort | Get current Hub tilt angle on the Y axis (-90 .90). Boost Hub only | x | x | 2.1.0+ | The Hub's tilt angle Y is displayed on the slider controller screen | ||||
Sensors | Boost Sensors | OrientationAngle | Captures data with the Boost hub and the Technic hub as well. Boost hub provides only X and Y data, Technic hub provides X, Y and Z data | x | x | 3.0.0+ | If the Hub moves (X value changes from 0) then a sound is played | ||||
Sensors | Boost Sensors | DrivebaseTiltConfigure OrientationAddressablePort | Supposed to set the tilt orientation of Boost hub but it does not override the value detected - more tests needed. | x | 2.1.0+ | ||||||
Sensors | Accelerometer | Captures data with the Boost hub and the Technic hub as well, exact information is unconfirmed | x | x | 3.0.0+ | ||||||
Sensors | WeDo Sensors | DistanceSensor AddressablePort | WeDo sensor only | x | x | 2.1.0+ | |||||
Sensors | WeDo Sensors | TiltSensorXAddressablePort | WeDo sensor only | x | x | 2.1.0+ | |||||
Sensors | WeDo Sensors | TiltSensorYAddressablePort | WeDo sensor only | x | x | 2.1.0+ | |||||
Sensors | Device Sensors | AccelerometerX | Uses the X axis tilt position of the smart device (left-right). 0 is the central position. | x | x | 3.0.0+ | The App-Controlled Batmobile can be controlled with this configuration, the smart device's orientation drives it forward-backward and turns it as well | ||||
Sensors | Device Sensors | AccelerometerY | Uses the y axis tilt position of the smart device (forward-backward). 0 is around 30 degrees with the device screen facing towards you. | x | x | 3.0.0+ | The App-Controlled Batmobile can be controlled with this configuration, the smart device's orientation drives it forward-backward and turns it as well | ||||
Sensors | Generic/Hub66/Button | Detects the button pressed on the A or B side of the connected remote | x | x | x | 3.1.0+ | The + button on the A side of the connected Remote will trigger the Tacho motor connected to the hub on port B to rotate by 90 degrees from the current position with the speed of 50 | ||||
Motors | Simple Motor (any) | MotorPower | Sets power to the motor - Positive numbers rotates clockwise and negative rotates counter clockwise - Power value can be between -100 and 100 | x | x | x | 2.1.0+ | Slider 1 sets the power of motor on port A, it's in a loop adjust the speed constantly according to the position of the slider. | |||
Motors | Simple Motor (any) | ContinuousMedium MotorControl | Sets power to the motor attached to the selected port and runs until the program runs without the need of a loop - Positive numbers rotates clockwise and negative rotates counter clockwise (Between -100 and 100) | x | x | x | 2.2.0+ | Slider 1 sets the speed of motor on port A. No need to put in a loop as the block with a rounded end runs continously. | Only appears on the controller interfaces | ||
Motors | Simple Motor (any) | MotorFloat | Removes power from the motor | x | x | x | 2.1.0+ | Tacho motor on port A runs at speed 50 for 2 seconds, then power is cut from the motor and it can be rotated freely | |||
Motors | Simple Motor (any) | ContinuousMediumMotor ControlSpeedSteering | Sets power to the motors attached to the selected ports and runs until the program runs without the need of a loop. First value sets the speed, second value defines steering (changing the speed of the motors to steer the vehicle), third value defines if both motors run in the same or opposite directions. | x | x | x | 2.4.0+ | The App-Controlled Batmobile can be controlled with this configuration, the smart device's orientation drives it forward-backward and turns it as well | Only appears on the controller interfaces | ||
Motors | Simple Motor (any) | MotorBrake | Stops the motor | x | x | 2.1.0+ | Tacho motor on port A runs at speed 50 for 2 seconds, then power is cut from the motor but the motor "brake" is on, difficult to turn | ||||
Motors | Tacho Motors only | TachoMotorGetSpeed | Reads the speed value of the motor attached to the specified port | x | x | x | 2.1.0+ | Speed of Tacho motor on port A is displayed on the Slider controller interface's left widget | |||
Motors | Tacho Motors only | TachoMotorSpeed | Run tacho motor on defined port with speed (-100..100) | x | x | x | 2.1.0+ | Slider 1 sets the speed of Tacho motor on port A, it's in a loop adjust the speed constantly according to the position of the slider. | |||
Motors | Tacho Motors only | TachoMotorSpeedDuration | Run tacho motor on defined port with speed (-100..100) for duration (in seconds) | x | x | 2.1.0+ | Tacho motor on port A runs for 5 seconds with speed 50, then stops and actively holds position | ||||
Motors | Tacho Motors only | TachoMotorGetPosition | Reads the position of the tacho motor. Position is relative, 0 is the position where the motor was turned on. | x | x | x | 2.1.0+ | Position of Tacho motor on port A is displayed on the Slider controller interface's left widget | |||
Motors | Tacho Motors only | TachoMotorSpeedDegrees | Turns the tacho motor on defined port with defined speed (-100..100) with the defined amount (-9999..9999 in degrees). In version 3.1.1 the negative value for the degrees does not affect the direction of the rotation, only the negative speed value | x | x | 3.1.0+ | The + button on the A side of the connected Remote will trigger the Tacho motor connected to the hub on port B to rotate by 90 degrees from the current position with the speed of 50 | ||||
Motors | Tacho Motors only | TachoMotorSpeedPosition | Turns the tacho motor on defined port with defined speed (-100..100) to the defined position (-9999..9999 in degrees) | x | x | 2.1.0+ | Position of Tacho motor on port A is set to 45, it turns with speed 50 | ||||
Motors | Tacho Motors only | TachoMotorPresetPosition | Sets the current position of the tacho motor on defined port to the defined value (-9999..9999 in degrees) | x | x | 2.1.0+ | Tacho motor's current position is set to 0 - position of the motor is relative, 0 is the "turn on" value, this can be resetted with this command to the current position | ||||
Motors | Tacho Motors only | TachoMotorHold | Stops and holds the tacho motor on defined port | x | x | 2.2.0+ | Tacho motor on port A runs for 5 seconds with speed 50, then stops and actively holds position | ||||
Motors | Tacho Motors only | TachoMotorMaxPower | Sets max power of the tacho motor on defined port (0..100) | x | 2.1.0+ | Sets the maximum power of the Tacho motor on port A to 25, then the speed is controlled with Slider 1 on the controller interface. With this change the motor only runs at 25%. | |||||
Motors | Tacho Motors only | TachoMotorAccelerationTime | Sets the acceleration duration (in seconds) of the tacho motor on defined port | x | 2.1.0+ | The acceleration and deceleration time of the Tacho motor on port A is set to 0.1, this makes the reaction to the slider movement very fast. | |||||
Motors | Tacho Motors only | TachoMotorDecelerationTime | Sets the deceleration duration (in seconds) of the tacho motor on defined port | x | 2.1.0+ | The acceleration and deceleration time of the Tacho motor on port A is set to 0.1, this makes the reaction to the slider movement very fast. | |||||
Motors | Simple Motor Pair | SynchroMotorPower | Sets independently the power (-100..100) of a pair of motors on the defined ports (AB or CD) | x | x | 2.1.0+ | The power of the motors attached to port AB is set to 50 | ||||
Motors | Tacho Motor Pair | SynchroTachoMotorSpeed | Sets independently the speed (-100..100) of a pair of tacho motors on the defined ports (AB or CD) | x | x | 2.1.0+ | The speed of the Tacho motors attached to port AB is set to 50. This command works for the Boost internal motors as well. | ||||
Motors | Tacho Motor Pair | SynchroTachoMotor SpeedDuration | Sets independently the speed (-100..100) of a pair of tacho motors on the defined ports (AB or CD) for duration (in seconds) | x | x | 2.1.0+ | The speed of the Tacho motors attached to port AB is set to 50 and they run for 5 seconds. This command works for the Boost internal motors as well. | ||||
Motors | Tacho Motor Pair | SynchroTachoMotor SpeedPosition | Sets the the position (-9999..9999) of a pair of tacho motors on the defined ports (AB or CD) with speed independently set (-100..100) | x | x | 2.1.0+ | The Tacho motors attached to port AB are both turned to 85 degrees position with the speed of 50. This command works for the Boost internal motors as well. | Command seems to add the defined position data to the current value instead of setting it as a target position | |||
Motors | Tacho Motor Pair | SynchroTachoMotor SpeedSteering | Sets the speed (-100..100) of a pair of tacho motors on the defined ports (AB or CD) with the steering direction (-100..100) defining a tank steering style behavior. 0 sets equal power to both outputs, 50 only powers one motor and 100 powers the motors in opposite directions. Positive-negative value for steering defines the direction. | x | x | 2.1.0+ | The Tacho motors attached to port AB tank-steered to 49% with the speed of 50. This command works for the Boost internal motors as well. | ||||
Motors | Tacho Motor Pair | SynchroTachoMotor SpeedSteeringDuration | Sets the speed (-100..100) of a pair of tacho motors on the defined ports (AB or CD) with the steering direction (-100..100) defining a tank steering style behavior. The motors are running for the defined duration (in sconds). 0 sets equal power to both outputs, 50 only powers one motor and 100 powers the motors in opposite directions. Positive-negative value for steering defines the direction. | x | x | 2.1.0+ | The Tacho motors attached to port AB tank-steered to 50% with the speed of 50 for 5 seconds. This command works for the Boost internal motors as well. | ||||
Motors | Tacho Motor Pair | SynchroTachoMotor SpeedSteeringPosition | Sets the speed (-100..100) of a pair of tacho motors on the defined ports (AB or CD) with the steering direction (-100..100) defining a tank steering style behavior. The motors are running until the defined degree of rotation is reached (-9999..9999 in degrees). 0 sets equal power to both outputs, 50 only powers one motor and 100 powers the motors in opposite directions. Positive-negative value for steering defines the direction. | x | x | 2.1.0+ | The Tacho motors attached to port AB tank-steered to the direction of 100% (meaning the 2 motors are running in opposite direction) with the speed of 50, and they both turn only 90 degrees. This command works for the Boost internal motors as well. | ||||
Custom Controller | Slider interface | widget-reporter-block-37 | Returns the current value of the AccelratorWidget 1 | x | x | x | 2.2.0+ | Run motor connected to port A with a given speed based on the value of the slider | Ony appears when Slider interface is used | ||
Custom Controller | Slider interface | widget-reporter-block-38 | Returns the current value of the AccelratorWidget 2 | x | x | x | 2.2.0+ | Similar to widget-reporter-block-37 | |||
Custom Controller | Slider interface | widget-reporter-block-39 | Starts the execution of the programming strip when the wheel button is pressed. | x | x | x | 2.2.0+ | When the wheel button on the controller screen is pressed the following sound will be executed | StartOnWheelChange | ||
Custom Controller | Slider interface | widget-reporter-block-40 | Starts the execution of the programming strip when the traffic light button is pressed. | x | x | x | 2.2.0+ | Similar to widget-reporter-block-39 | StartOnTrafficlightChange | ||
Custom Controller | Slider interface | widget-reporter-block-41 | Starts the execution of the programming strip when the road button is pressed. | x | x | x | 2.2.0+ | Similar to widget-reporter-block-39 | StartOnRoadChange | ||
Custom Controller | Slider interface | widget-reporter-block-42 | Returns the current value of the SpeedoMeter Widget 1 Usually used to trigger the execution of other programming strips based on its value | x | x | 2.2.0+ | If the value of the widget is below 50 then the LED on the hub is red, over 50 it turns green. Enclosed in a loop for constant monitoring of the slider position. | SpeedoMeterPosition1? | |||
Custom Controller | Slider interface | widget-reporter-block-43 | Returns the current value of the SpeedoMeter Widget 2 Usually used to trigger the execution of other programming strips based on its value | x | x | 2.2.0+ | Similar to widget-reporter-block-42 | SpeedoMeterPosition2? | |||
Custom Controller | Slider interface | widget-instruction-block-38 | Slider Widget 1 that can go from -100 to 100 | x | x | 2.2.0+ | Changes the start position of Slider 1, in this case it starts with the value 50 | Ony appears when Slider interface is used | |||
Custom Controller | Slider interface | widget-instruction-block-39 | Slider Widget 2 that can go from -100 to 100 | x | x | 2.2.0+ | Similar to widget-reporter-block-43 | ||||
Custom Controller | Slider interface | widget-instruction-block-40 | Boolean Widget that can trigger the StartOnWheelChange block - Triggers the widget when the condition is true | x | 2.2.0+ | The Wheel widget is triggered when the slider is moved (value is changed from 0) - the Wheel widget needs to be also defined like in the example of widget-reporter-block-39 | Ony appears when Slider interface is used | ||||
Custom Controller | Slider interface | widget-instruction-block-41 | Boolean Widget that can trigger the StartOnTrafficlightChange block - Triggers the widget when the condition is true | x | 2.2.0+ | Similar to widget-instruction-block-40 | Ony appears when Slider interface is used | ||||
Custom Controller | Slider interface | widget-instruction-block-42 | Boolean Widget that can trigger theS tartOnRoadChange block - Triggers the widget when the condition is true | x | 2.2.0+ | Similar to widget-instruction-block-40 | Ony appears when Slider interface is used | ||||
Custom Controller | Slider interface | widget-instruction-block-43 | Widget that can display a numeric value on the controller screen (left) | x | x | x | 2.2.0+ | The widget display a numeric value on the Controller interface, in this case it displays the speed of the Tacho motor on port A | Ony appears when Slider interface is used | ||
Custom Controller | Slider interface | widget-instruction-block-44 | Widget that can display a numeric value on the controller screen (right) | x | x | x | 2.2.0+ | Similar to widget-instruction-block-43 | Ony appears when Slider interface is used | ||
Custom Controller | Race Car interface | widget-reporter-block-55 | Starts the execution of the programming strip when the wheel button is pressed. | x | x | x | 2.4.0+ | Similar to widget-reporter-block-39 | |||
Custom Controller | Race Car interface | widget-reporter-block-56 | Starts the execution of the programming strip when the tools button is pressed. | x | x | x | 2.4.0+ | Similar to widget-reporter-block-39 | |||
Custom Controller | Race Car interface | widget-reporter-block-57 | Starts the execution of the programming strip when the flags button is pressed. | x | x | x | 2.4.0+ | Similar to widget-reporter-block-39 | |||
Custom Controller | Race Car interface | widget-reporter-block-58 | Starts the execution of the programming strip when the red button is pressed. | x | x | x | 2.4.0+ | Similar to widget-reporter-block-39 | |||
Custom Controller | Race Car interface | widget-reporter-block-59a | Returns the current X (horizontal) value of the joystick (-100..100) | x | x | x | 2.4.0+ | ||||
Custom Controller | Race Car interface | widget-reporter-block-59b | Returns the current Y (vertical) value of the joystick (-100..100) | x | x | x | 2.4.0+ | The value is used to change the speed of the simple motor attached to port A | |||
Custom Controller | Race Car interface | widget-reporter-block-59c | Returns the relative distance of the joystick from 0, positive/negative value depends on the forward/backward direction (-100..100). | x | x | x | 2.4.0+ | The value is used to change the speed of the simple motor attached to port A | |||
Custom Controller | Race Car interface | widget-reporter-block-59d | Returns the steering angle value of the joystick (-90..90) | x | x | x | 2.4.0+ | ||||
Custom Controller | Race Car interface | widget-reporter-block-60 | Assumption - should return the value of the speed meter widget (-100..100) but always stays 0 | x | x | 2.4.0+ | |||||
Custom Controller | Race Car interface | widget-reporter-block-62 | Returns the value of the turbo widget (0..100) | x | x | 2.4.0+ | |||||
Custom Controller | Race Car interface | widget-instruction-block-55 | Triggers wheel widget when the condition is true | x | 2.4.0+ | Similar to widget-instruction-block-40 | |||||
Custom Controller | Race Car interface | widget-instruction-block-56 | Triggers tools widget when the condition is true | x | 2.4.0+ | Similar to widget-instruction-block-40 | |||||
Custom Controller | Race Car interface | widget-instruction-block-57 | Triggers flag widget when the condition is true | x | 2.4.0+ | Similar to widget-instruction-block-40 | |||||
Custom Controller | Race Car interface | widget-instruction-block-58 | Triggers red button widget when the condition is true | x | 2.4.0+ | Similar to widget-instruction-block-40 | |||||
Custom Controller | Race Car interface | widget-instruction-block-59a | Joystick X (horizontal) axis Widget that can go from -100 to 100 | x | x | 2.4.0+ | |||||
Custom Controller | Race Car interface | widget-instruction-block-59b | Joystick Y (vertical) axis Widget that can go from -100 to 100 | x | x | 2.4.0+ | |||||
Custom Controller | Race Car interface | widget-instruction-block-59c | Joystick X (horizontal) and Y (vertical) axis Widget that can go from -100 to 100 | x | 2.4.0+ | ||||||
Custom Controller | Race Car interface | widget-instruction-block-60 | Sets the value of the speed meter widget | x | x | x | 2.4.0+ | Similar to widget-instruction-block-43 | |||
Custom Controller | Race Car interface | widget-instruction-block-62 | Sets the value of the turbo widget | x | x | x | 2.4.0+ | Similar to widget-instruction-block-43 | |||
Light & Sound | Dimmable Light | LightPercentage | Sets the power of the attached LED on the defined port to % (0..100) | x | x | x | 2.1.0+ | If Slider 1's position is not 0 then sets the light intensity on port D to 100% | |||
Light & Sound | Color Light | SetHubLightIndexColor AddressablePort | Set the Hub LED to show color - Works on Boost/City/Technic hubs | x | x | x | 2.1.0+ | The Hub's LED light is set to red and then off 3 times - this makes the LED blink quickly in red 3 times | |||
Light & Sound | Color Light | SetHubLightRGBColor AddressablePort | Sets the Hub LED to show color based on the RGB intensity defined (Red, Green and Blue value in %). Works on Boost/City/Technic hubs | x | x | x | 3.0.0+ | Sets the Hub's LED light to Red - 0%, Green - 50% and Blue: 100% | |||
Light & Sound | Color Light | VisionSensorSetColor AddressablePort | Sets the color of the Sensor LED. Boost sensor only | x | x | x | 2.1.0+ | Sets the color of the Boost sensor attached to port A to blue | |||
Light & Sound | Sound | PlaySoundHouse | Play the selected sound from the House sound library | x | x | x | 2.1.0+ | Plays the first sound effect from the House sound library | |||
Light & Sound | Sound | PlaySoundWhistle | Play the selected sound from the Whistle sound library | x | x | x | 2.1.0+ | Similar to PlaySoundHouse | |||
Light & Sound | Sound | PlaySoundTrain | Play the selected sound from the Train sound library | x | x | x | 2.1.0+ | Similar to PlaySoundHouse | |||
Light & Sound | Sound | PlaySoundCar | Play the selected sound from the Car sound library | x | x | x | 2.1.0+ | Similar to PlaySoundHouse | |||
Light & Sound | Sound | PlaySoundPlane | Play the selected sound from the Plane sound library | x | x | x | 2.1.0+ | Similar to PlaySoundHouse | |||
Light & Sound | Sound | PlaySoundDog | Play the selected sound from the Dog sound library | x | x | x | 2.1.0+ | Similar to PlaySoundHouse | |||
Light & Sound | Sound | PlaySoundCat | Play the selected sound from the Cat sound library | x | x | x | 2.1.0+ | Similar to PlaySoundHouse | |||
Light & Sound | Sound | PlaySoundFart | Play the selected sound from the Fart sound library | x | x | x | 2.1.0+ | Similar to PlaySoundHouse | |||
Light & Sound | Sound | PlaySoundHorn | Play the selected sound from the Horn sound library | x | x | x | 2.1.0+ | Similar to PlaySoundHouse | |||
Light & Sound | Sound | PlaySoundCrowd | Play the selected sound from the Crowd sound library | x | x | x | 2.1.0+ | Similar to PlaySoundHouse | |||
Light & Sound | Sound | PlaySoundRobot | Play the selected sound from the Robot sound library | x | x | x | 2.1.0+ | Similar to PlaySoundHouse | |||
Light & Sound | Sound | PlaySoundTarget | Play the selected sound from the Target sound library | x | x | x | 2.1.0+ | Similar to PlaySoundHouse | |||
Light & Sound | IR | SendIRMessage | Sends IR commands to the Power Functions IR reciever with the Color and Distance sensor connected to the port defined.The first parameter is the port where the sensor is attached. The second is the IR channel used from 0 to 3 matching IR port 1 to 4. The third defines multiple things, but for basic usage set 4 to control the red port, 5 to control the blue port. The fourth sets the speed, 0 is float (no speed), 1 to 7 is increasing speed forward, 8 is stop, 9 to F is decreasing speed backwards. | x | 3.1.0+ | The first block sets the Color and Distance sensor attached to port A to mode 7 to transmit IR signals, that is needed before sending the commands. The second block sends the signal, the first parameter is the port where the sensor is attached. The second is the IR channel used from 0 to 3 matching IR port 1 to 4. The third defines multiple things, but for basic usage set 4 to control the red port, 5 to control the blue port. The fourth sets the speed, 0 is float (no speed), 1 to 7 is increasing speed forward, 8 is stop, 9 to F is decreasing speed backwards. | |||||
Light & Sound | IR | SetColorAndDistanceSensorMode | Sets the mode of the Color and Distance sensor connected to the defined port. Mode 7 has to be used to control the Power Functions IR receiver | x | 3.1.0+ | The first block sets the Color and Distance sensor attached to port A to mode 7 to transmit IR signals, that is needed before sending the commands. The second block sends the signal, the first parameter is the port where the sensor is attached. The second is the IR channel used from 0 to 3 matching IR port 1 to 4. The third defines multiple things, but for basic usage set 4 to control the red port, 5 to control the blue port. The fourth sets the speed, 0 is float (no speed), 1 to 7 is increasing speed forward, 8 is stop, 9 to F is decreasing speed backwards. | |||||
Data Operations | Variable | LEGODeviceAddress AndPortSelector | Sets the device and port to be used. Device number (1..4) is set on the connection screen (Bluetooth icon in top-left corner). Port can be either internal (connector icon) or external. | x | 3.0.0+ | Sets the speed of the normal motor attached to port B of the second hub on the connection list. The speed is set to the value stored in the local variable a. | |||||
Data Operations | Variable | LocalVariableFetch | Reads the number stored in the local variable. Local variables are not shared between the main program and the composite blocks. | x | x | 2.4.0+ | Sets the speed of the normal motor attached to port B of the second hub on the connection list. The speed is set to the value stored in the local variable a. | ||||
Data Operations | Variable | LocalVariableStore | Updates local variable to store number. Local variables are not shared between the main program and the composite blocks. | x | x | 2.4.0+ | Sets the value of the local variable a to 50. | ||||
Data Operations | Variable | GlobalVariableFetch | Reads the number stored in the global variable - Global variables are shared between the main program and the composite blocks. | x | 2.1.0+ | Similar to LocalVariableFetch, the difference is that this variable is shared between the main program and the composite blocks. | |||||
Data Operations | Variable | GlobalVariableStore | Update global variable to store number - Global variables are shared between the main program and the composite blocks. | x | 2.1.0+ | Similar to LocalVariableStore, the difference is that this variable is shared between the main program and the composite blocks. | |||||
Data Operations | Variable | InvertInput | Inverts the input value (+/-) | x | x | x | 2.2.0+ | The App-Controlled Batmobile can be controlled with this configuration, the smart device's orientation drives it forward-backward and turns it as well. The InvertInput block is used to invert one of tilt values of the smart device to match the turning direction of the vehicle | only on Controller interface | ||
Data Operations | Variable | RandomOperator | Returns a random number between number and number (both numbers included in the range). | x | x | 2.1.0+ | The value of the local variable b is a random number between 1 and 10 | ||||
Data Operations | Comparision | EqualOperator | Returns whether number is equal to number. | x | x | 2.1.0+ | Plays the engine revving sound until the slider's value equals to 0 | ||||
Data Operations | Comparision | LessThanOperator | Returns whether number is less than number. | x | x | 2.1.0+ | Usage principle is similar to EqualOperator | ||||
Data Operations | Comparision | GreaterThanOperator | Returns whether number is greater than number. | x | x | 2.1.0+ | Usage principle is similar to EqualOperator | ||||
Data Operations | Comparision | NotEqualOperator | Returns whether number is not equal to number. | x | x | 2.1.0+ | Usage principle is similar to EqualOperator | ||||
Data Operations | Comparision | AndOperator | Returns true if both operators are true, and false otherwise. | x | 2.1.0+ | Sound is triggered if both sliders are moved (their position is not equal to 0) | |||||
Data Operations | Comparision | OrOperator | Returns true if either operand is true, and false otherwise | x | 2.1.0+ | Sound is triggered if one of the sliders is moved (position is not equal to 0) | |||||
Data Operations | Math | PlusOperator | Returns the result of adding number to number. | x | x | 2.1.0+ | Usage principle is similar to EqualOperator | ||||
Data Operations | Math | MinusOperator | Returns the result of number substracted with number. | x | x | 2.1.0+ | Usage principle is similar to EqualOperator | ||||
Data Operations | Math | MultiplyOperator | Returns the result of number multiplied with number. | x | x | 2.1.0+ | Usage principle is similar to EqualOperator | ||||
Data Operations | Math | DivisionOperator | Returns the reuslt of number divided by number. | x | x | 2.1.0+ | Usage principle is similar to EqualOperator | ||||
Data Operations | Math | AdvancedMath | Supports the following mathematical operations: Round to nearest, Round down, Round up, Absolute value, Squareroot, Squared, Sine, Cosine, Tangent, Arcsine, Arccosine and Arctangent, radians to degrees conversion. | x | 3.0.0+ | If the slider's position is below 50 in either direction (+/-) then the LED on the hub is red, over 50 it turns green. Advanced operator "Absolute value" is used to have the red range between -50 and 50. Enclosed in a loop for constant monitoring of the slider position. | |||||
Data Operations | Math | Atan2 | Returns the result of the function {atan2} (y,x) or {arctan2} (y,x) | x | 3.0.0+ | ||||||
Data Operations | Math | Exponent | Returns the result of raising number (first value) to the power of the exponent (second value). | x | 3.0.0+ | ||||||
Data Operations | Math | Max | Returns the maximum value of number (first value) and number (second value). | x | 3.0.0+ | ||||||
Data Operations | Math | Min | Returns the minimum value of number (first value) and number (second value). | x | 3.0.0+ | ||||||
Data Operations | Math | Modulo | Returns the remainder after divison of number (first value) by number (second value). | x | 3.0.0+ | ||||||
Composite Block | CreateCompositeBlock | Creates a composite block that acts as a program inside our program and can be executed by its custom icon. | x | x | x | 2.4.0+ | |||||
Composite Block | Race Car interface | CompositeBlockFueling | Predefined Composite Block in the Race Car interface | x | x | x | 2.4.0+ | ||||
Composite Block | Race Car interface | CompositeBlockJoystick | Predefined Composite Block in the Race Car interface | x | x | x | 2.4.0+ | ||||
Composite Block | Race Car interface | CompositeBlockCrash | Predefined Composite Block in the Race Car interface | x | x | x | 2.4.0+ |