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 simple code block guide for the LEGO® Powered Up app. It is created to provide help with Powered Up programming, it contains information about the code blocks used in the Free Play area of the app.
Latest update: 04/29/2020
App version used: 3.1.1
Usage
This is the simplified version of the code block guide. Click here for the extended version with all the information, column filtering, search function etc.
In this version each block can be identified with the icon, the number of the visible columns depends on your screen size / resolution. To show all data corresponding to a block click on the Green + icon next to the block’s image, that will show/hide the additional information.
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.
If you have issues with the table width (right column not fully visible) then please try to reload the page.
Block Image | Block Category | Block Name | Description (official / my notes) | Example | Example (code) |
---|---|---|---|---|---|
Flow Blocks | Start | Starts the execution of the attached sequence when the block is clicked or when the program starts. | 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. | 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. | 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. | 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. | 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). | 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. | 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. | 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. | Plays the engine revving sound until the slider is moved | ||
Flow Blocks | LoopForever | Loop enclosed sequence forever. | 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. | 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. | 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. | 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. | 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 | TriggerOnColor | Triggers when the color measured by the Sensor is equal to color. Boost Sensor only | If the sensor attached to port C detects red then the sound is played | ||
Sensors | WaitForColor | Wait for the color measured by the Sensor to be equal to color. Boost sensor only | 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 | ColorSensor | Get current color measured by the Sensor. Boost sensor only | The Hub's sensor is set to the color what the sensor attached to port C detects | ||
Sensors | TriggerOnDistancelessThan | Triggers when the distance measured by the Sensor is less than distance. Boost sensor only | If the sensor detects something at distance 5 then the sound is played | ||
Sensors | WaitForDistancelessThan | Wait for the distance measured by the Sensor to be less than distance. Boost sensor only. | 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 | VisionProximitySensor AddressablePort | Get current distance measured by the Sensor. Boost sensor only | If something gets closer to the sensor than distance '5' then the sound is played | ||
Sensors | VisionReflectionSensor AddressablePort | Get current ambient light level measured by the Sensor. Boost sensor only | If the something covers the light sensor (value becomes greater than 2) then the sound is played | ||
Sensors | TriggerOnOrientation | Triggers when the Hub Orientation is equal to Hub Orientation. Boost hub only | If the Hub's orientation becomes horizontal then the Hub's LED color switched to red | ||
Sensors | WaitForOrientation | Wait for the Hub orientation to be equal to Hub orientation. Boost hub only | If the Hub's orientation becomes horizontal then the Hub's LED color switched to red | ||
Sensors | DriveBaseTiltGetOrientation AddressablePort | Get current Hub orientation. Boost hub only | The Hub's orientation is stored in variable "a" and can be used as an input in other sequences | ||
Sensors | DriverbaseTiltGetAngleX AddressablePort | Get current Hub tilt angle on the X axis (-90 .90). Boost Hub only | The Hub's tilt angle X is displayed on the slider controller screen | ||
Sensors | DriverbaseTiltGetAngleY AddressablePort | Get current Hub tilt angle on the Y axis (-90 .90). Boost Hub only | The Hub's tilt angle Y is displayed on the slider controller screen | ||
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 | If the Hub moves (X value changes from 0) then a sound is played | ||
Sensors | DrivebaseTiltConfigure OrientationAddressablePort | Supposed to set the tilt orientation of Boost hub but it does not override the value detected - more tests needed. | |||
Sensors | Accelerometer | Captures data with the Boost hub and the Technic hub as well, exact information is unconfirmed | |||
Sensors | DistanceSensor AddressablePort | WeDo sensor only | |||
Sensors | TiltSensorXAddressablePort | WeDo sensor only | |||
Sensors | TiltSensorYAddressablePort | WeDo sensor only | |||
Sensors | AccelerometerX | Uses the X axis tilt position of the smart device (left-right). 0 is the central position. | 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 | 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. | 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 | 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 | MotorPower | Sets power to the motor - Positive numbers rotates clockwise and negative rotates counter clockwise - Power value can be between -100 and 100 | 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 | 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) | 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. | ||
Motors | MotorFloat | Removes power from the motor | 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 | 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. | The App-Controlled Batmobile can be controlled with this configuration, the smart device's orientation drives it forward-backward and turns it as well | ||
Motors | MotorBrake | Stops the motor | 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 | TachoMotorGetSpeed | Reads the speed value of the motor attached to the specified port | Speed of Tacho motor on port A is displayed on the Slider controller interface's left widget | ||
Motors | TachoMotorSpeed | Run tacho motor on defined port with speed (-100..100) | 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 | TachoMotorSpeedDuration | Run tacho motor on defined port with speed (-100..100) for duration (in seconds) | Tacho motor on port A runs for 5 seconds with speed 50, then stops and actively holds position | ||
Motors | TachoMotorGetPosition | Reads the position of the tacho motor. Position is relative, 0 is the position where the motor was turned on. | Position of Tacho motor on port A is displayed on the Slider controller interface's left widget | ||
Motors | 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 | 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 | TachoMotorSpeedPosition | Turns the tacho motor on defined port with defined speed (-100..100) to the defined position (-9999..9999 in degrees) | Position of Tacho motor on port A is set to 45, it turns with speed 50 | ||
Motors | TachoMotorPresetPosition | Sets the current position of the tacho motor on defined port to the defined value (-9999..9999 in degrees) | 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 | TachoMotorHold | Stops and holds the tacho motor on defined port | Tacho motor on port A runs for 5 seconds with speed 50, then stops and actively holds position | ||
Motors | TachoMotorMaxPower | Sets max power of the tacho motor on defined port (0..100) | 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 | TachoMotorAccelerationTime | Sets the acceleration duration (in seconds) of the tacho motor on defined port | 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 | TachoMotorDecelerationTime | Sets the deceleration duration (in seconds) of the tacho motor on defined port | 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 | SynchroMotorPower | Sets independently the power (-100..100) of a pair of motors on the defined ports (AB or CD) | The power of the motors attached to port AB is set to 50 | ||
Motors | SynchroTachoMotorSpeed | Sets independently the speed (-100..100) of a pair of tacho motors on the defined ports (AB or CD) | 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 | 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) | 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 | 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) | 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. | ||
Motors | 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. | 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 | 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. | 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 | 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. | 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 | widget-reporter-block-37 | Returns the current value of the AccelratorWidget 1 | Run motor connected to port A with a given speed based on the value of the slider | ||
Custom Controller | widget-reporter-block-38 | Returns the current value of the AccelratorWidget 2 | Similar to widget-reporter-block-37 | ||
Custom Controller | widget-reporter-block-39 | Starts the execution of the programming strip when the wheel button is pressed. | When the wheel button on the controller screen is pressed the following sound will be executed | ||
Custom Controller | widget-reporter-block-40 | Starts the execution of the programming strip when the traffic light button is pressed. | Similar to widget-reporter-block-39 | ||
Custom Controller | widget-reporter-block-41 | Starts the execution of the programming strip when the road button is pressed. | Similar to widget-reporter-block-39 | ||
Custom Controller | 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 | 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. | ||
Custom Controller | 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 | Similar to widget-reporter-block-42 | ||
Custom Controller | widget-instruction-block-38 | Slider Widget 1 that can go from -100 to 100 | Changes the start position of Slider 1, in this case it starts with the value 50 | ||
Custom Controller | widget-instruction-block-39 | Slider Widget 2 that can go from -100 to 100 | Similar to widget-reporter-block-43 | ||
Custom Controller | widget-instruction-block-40 | Boolean Widget that can trigger the StartOnWheelChange block - Triggers the widget when the condition is true | 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 | ||
Custom Controller | widget-instruction-block-41 | Boolean Widget that can trigger the StartOnTrafficlightChange block - Triggers the widget when the condition is true | Similar to widget-instruction-block-40 | ||
Custom Controller | widget-instruction-block-42 | Boolean Widget that can trigger theS tartOnRoadChange block - Triggers the widget when the condition is true | Similar to widget-instruction-block-40 | ||
Custom Controller | widget-instruction-block-43 | Widget that can display a numeric value on the controller screen (left) | The widget display a numeric value on the Controller interface, in this case it displays the speed of the Tacho motor on port A | ||
Custom Controller | widget-instruction-block-44 | Widget that can display a numeric value on the controller screen (right) | Similar to widget-instruction-block-43 | ||
Custom Controller | widget-reporter-block-55 | Starts the execution of the programming strip when the wheel button is pressed. | Similar to widget-reporter-block-39 | ||
Custom Controller | widget-reporter-block-56 | Starts the execution of the programming strip when the tools button is pressed. | Similar to widget-reporter-block-39 | ||
Custom Controller | widget-reporter-block-57 | Starts the execution of the programming strip when the flags button is pressed. | Similar to widget-reporter-block-39 | ||
Custom Controller | widget-reporter-block-58 | Starts the execution of the programming strip when the red button is pressed. | Similar to widget-reporter-block-39 | ||
Custom Controller | widget-reporter-block-59a | Returns the current X (horizontal) value of the joystick (-100..100) | |||
Custom Controller | widget-reporter-block-59b | Returns the current Y (vertical) value of the joystick (-100..100) | The value is used to change the speed of the simple motor attached to port A | ||
Custom Controller | widget-reporter-block-59c | Returns the relative distance of the joystick from 0, positive/negative value depends on the forward/backward direction (-100..100). | The value is used to change the speed of the simple motor attached to port A | ||
Custom Controller | widget-reporter-block-59d | Returns the steering angle value of the joystick (-90..90) | |||
Custom Controller | widget-reporter-block-60 | Assumption - should return the value of the speed meter widget (-100..100) but always stays 0 | |||
Custom Controller | widget-reporter-block-62 | Returns the value of the turbo widget (0..100) | |||
Custom Controller | widget-instruction-block-55 | Triggers wheel widget when the condition is true | Similar to widget-instruction-block-40 | ||
Custom Controller | widget-instruction-block-56 | Triggers tools widget when the condition is true | Similar to widget-instruction-block-40 | ||
Custom Controller | widget-instruction-block-57 | Triggers flag widget when the condition is true | Similar to widget-instruction-block-40 | ||
Custom Controller | widget-instruction-block-58 | Triggers red button widget when the condition is true | Similar to widget-instruction-block-40 | ||
Custom Controller | widget-instruction-block-59a | Joystick X (horizontal) axis Widget that can go from -100 to 100 | |||
Custom Controller | widget-instruction-block-59b | Joystick Y (vertical) axis Widget that can go from -100 to 100 | |||
Custom Controller | widget-instruction-block-59c | Joystick X (horizontal) and Y (vertical) axis Widget that can go from -100 to 100 | |||
Custom Controller | widget-instruction-block-60 | Sets the value of the speed meter widget | Similar to widget-instruction-block-43 | ||
Custom Controller | widget-instruction-block-62 | Sets the value of the turbo widget | Similar to widget-instruction-block-43 | ||
Light & Sound | LightPercentage | Sets the power of the attached LED on the defined port to % (0..100) | If Slider 1's position is not 0 then sets the light intensity on port D to 100% | ||
Light & Sound | SetHubLightIndexColor AddressablePort | Set the Hub LED to show color - Works on Boost/City/Technic hubs | 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 | 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 | Sets the Hub's LED light to Red - 0%, Green - 50% and Blue: 100% | ||
Light & Sound | VisionSensorSetColor AddressablePort | Sets the color of the Sensor LED. Boost sensor only | Sets the color of the Boost sensor attached to port A to blue | ||
Light & Sound | PlaySoundHouse | Play the selected sound from the House sound library | Plays the first sound effect from the House sound library | ||
Light & Sound | PlaySoundWhistle | Play the selected sound from the Whistle sound library | Similar to PlaySoundHouse | ||
Light & Sound | PlaySoundTrain | Play the selected sound from the Train sound library | Similar to PlaySoundHouse | ||
Light & Sound | PlaySoundCar | Play the selected sound from the Car sound library | Similar to PlaySoundHouse | ||
Light & Sound | PlaySoundPlane | Play the selected sound from the Plane sound library | Similar to PlaySoundHouse | ||
Light & Sound | PlaySoundDog | Play the selected sound from the Dog sound library | Similar to PlaySoundHouse | ||
Light & Sound | PlaySoundCat | Play the selected sound from the Cat sound library | Similar to PlaySoundHouse | ||
Light & Sound | PlaySoundFart | Play the selected sound from the Fart sound library | Similar to PlaySoundHouse | ||
Light & Sound | PlaySoundHorn | Play the selected sound from the Horn sound library | Similar to PlaySoundHouse | ||
Light & Sound | PlaySoundCrowd | Play the selected sound from the Crowd sound library | Similar to PlaySoundHouse | ||
Light & Sound | PlaySoundRobot | Play the selected sound from the Robot sound library | Similar to PlaySoundHouse | ||
Light & Sound | PlaySoundTarget | Play the selected sound from the Target sound library | Similar to PlaySoundHouse | ||
Light & Sound | 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. | 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 | 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 | 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 | 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. | 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 | LocalVariableFetch | Reads the number stored in the local variable. Local variables are not shared between the main program and the composite blocks. | 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 | LocalVariableStore | Updates local variable to store number. Local variables are not shared between the main program and the composite blocks. | Sets the value of the local variable a to 50. | ||
Data Operations | GlobalVariableFetch | Reads the number stored in the global variable - Global variables are shared between the main program and the composite blocks. | Similar to LocalVariableFetch, the difference is that this variable is shared between the main program and the composite blocks. | ||
Data Operations | GlobalVariableStore | Update global variable to store number - Global variables are shared between the main program and the composite blocks. | Similar to LocalVariableStore, the difference is that this variable is shared between the main program and the composite blocks. | ||
Data Operations | InvertInput | Inverts the input value (+/-) | 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 | ||
Data Operations | RandomOperator | Returns a random number between number and number (both numbers included in the range). | The value of the local variable b is a random number between 1 and 10 | ||
Data Operations | EqualOperator | Returns whether number is equal to number. | Plays the engine revving sound until the slider's value equals to 0 | ||
Data Operations | LessThanOperator | Returns whether number is less than number. | Usage principle is similar to EqualOperator | ||
Data Operations | GreaterThanOperator | Returns whether number is greater than number. | Usage principle is similar to EqualOperator | ||
Data Operations | NotEqualOperator | Returns whether number is not equal to number. | Usage principle is similar to EqualOperator | ||
Data Operations | AndOperator | Returns true if both operators are true, and false otherwise. | Sound is triggered if both sliders are moved (their position is not equal to 0) | ||
Data Operations | OrOperator | Returns true if either operand is true, and false otherwise | Sound is triggered if one of the sliders is moved (position is not equal to 0) | ||
Data Operations | PlusOperator | Returns the result of adding number to number. | Usage principle is similar to EqualOperator | ||
Data Operations | MinusOperator | Returns the result of number substracted with number. | Usage principle is similar to EqualOperator | ||
Data Operations | MultiplyOperator | Returns the result of number multiplied with number. | Usage principle is similar to EqualOperator | ||
Data Operations | DivisionOperator | Returns the reuslt of number divided by number. | Usage principle is similar to EqualOperator | ||
Data Operations | 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. | 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 | Atan2 | Returns the result of the function {atan2} (y,x) or {arctan2} (y,x) | |||
Data Operations | Exponent | Returns the result of raising number (first value) to the power of the exponent (second value). | |||
Data Operations | Max | Returns the maximum value of number (first value) and number (second value). | |||
Data Operations | Min | Returns the minimum value of number (first value) and number (second value). | |||
Data Operations | Modulo | Returns the remainder after divison of number (first value) by number (second value). | |||
Composite Block | CreateCompositeBlock | Creates a composite block that acts as a program inside our program and can be executed by its custom icon. | |||
Composite Block | CompositeBlockFueling | Predefined Composite Block in the Race Car interface | |||
Composite Block | CompositeBlockJoystick | Predefined Composite Block in the Race Car interface | |||
Composite Block | CompositeBlockCrash | Predefined Composite Block in the Race Car interface |