Report axle position

This block will report a motor axle position value in degress.

Report axle position has one input and one output. The input value is the port address, to which the motor is connected.
The output value is the motor axle rotation in degrees.

This coding block is compatible will all hubs.

This coding block is compatible with motors that have a speed sensor

Device nameCompatible
WeDo 2.0 Medium Motorno
Medium Linear Motoryes
Technic™ Large Motoryes
Technic™ XL Motoryes
Technic™ Small Angular Motoryes
Medium Angular Motoryes
Large Angular Motoryes
Train Motoryes
Move Hubyes

LEGO® Powered UP App coding example: Report axle position

For this example, you will need:

Step 1: Add coding blocks

  • Flow block – Start  
  • Motor block – Run the motor for a specified time, select hub port A, select power 27, select time 1
  • Motor block – Report axle position, select hub port A

Take care not to move the motor axle. Report axle position output should be 0

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 is spinning at full power, for 1 second, the motor axle should rotate 1 time. Observe, that Report axle position output has changed to 365

Back to Motor Blocks page

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *