Table of Contents

Every one of Marty's motors is a Smart Servo. That means it can report back its position (in degrees) and the amount of force on it. Which means we can use Marty's motors as sensors.

We can get these readings in Blocks and in the Sensor Dashboard, where we can view and graph readings from each of Marty's motors in real time!

In Blocks

You can find the joint position block in the sensing section of Blocks:

Blocks Motor Pos

Click the check box next to the sensor block, and you'll be able to see the reading change as you move Marty's joint! You can select which joint from the dropdown list in the block.

Remember, the “Left” and “Right” joints are Marty's left and right, so if you're facing Marty they'll be the other way round for you!

Copying movements

This simple script will make Marty's left arm copy the movements you make on the right:

Blocks Left Arm Copy Right Arm

Recording and Playing back movements

This example is a little more complex, and uses lists and variables to build up a series of positions for Marty's arm to move through.

First off, we'll create a list of angles. Click the “Make a List” button in the Variables section:

Arm Angles List Blocks

Name the list armAngles. We'll use it to store a list of joint positions we want Marty to reproduce.

Add Arm Pos To List

Move Marty's left arm to a position you want, then click on the block. You'll see the angle be added to the list! Do this a number of times to add several angles.

If you want to clear items from the list, you can use the delete block to remove a specific entry or the delete all block to wipe the list.

Delete List Items Blocks

Once we've built up the list, we can get Marty to play it back! We'll need to use a variable to count through the list, so make one called index.

Index Var Blocks With Arm Angles List

Example code:

Marty Arm Moving List Entries Code

Next steps: