This block will rotate the motor axle, for the motor connected to a specified hub port, at a specified power, for a specified amount of degrees.
Rotate axle block as first input accepts Hub port address. Each hub port has a physical letter printed on its body.
Rotate axle block as a second input accepts motor power value. Values can range from -100 to 100. When the value is a positive number, the motor spins clockwise, when the value is a negative number, the motor spins counterclockwise.
Rotate axle block as a third input accepts axle turn angle, 360 is full axle rotation
The coding block is compatible with all hubs.
The coding block is compatible with motors that have a rotation sensor.
Device name | Compatible |
WeDo 2.0 Medium Motor | no |
Medium Linear Motor | yes |
Technic™ Large Motor | yes |
Technic™ XL Motor | yes |
Technic™ Small Angular Motor | yes |
Medium Angular Motor | yes |
Large Angular Motor | yes |
Train Motor | no |
Move Hub | yes |
LEGO® Powered UP App coding example: Rotate motor axle 1 turn
For this example, you will need:
- Hub – any hub from Hubs compatible with LEGO® Powered UP App list will work
- Motor – any motor that has speed sensor from Motors compatible with LEGO® Powered UP App list will work
Step 1: Add coding blocks
- Flow block – Start
- Motor block – Rotate axle select hub port A, select power 50, select turn angle 360
Step 2: Setup motor and hub
- Connect the motor to port A
- Connect the hub to a device that runs the Powered UP App
Step 3: Run the program. Observe that the motor turns one full rotation and stops.
Step 4 (optional): Change the axle turn angle to 0 and restart the program. Observe that a motor axle does not rotate.
Leave a Reply Cancel reply