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 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 | yes |
Move Hub | yes |
LEGO® Powered UP App coding example: Report axle position
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 – 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
Leave a Reply Cancel reply