Intro to Marty the robot
Learn how to program your Marty using Scratch, and a few tips for getting the most from your robot friend!
what you will need
- A Scratch 3 compatible device with Wifi - a laptop or tablet
- Marty the Robot
What will you learn about?
- How Marty behaves, and how to care for your Marty
- How to connect to Marty from Scratch, and program sequences of movements!
- How to change parameters to change Marty's behaviour
extra information for educators
This tutorial walks students through the basics of how to use Marty, but also introduces the concepts of sequences of operations, parameters, and simple loops
Introduction - how to train your marty
Congratulations on getting a marty!
You’ve now got a robot friend for life!
But, there are several things you should know about caring for your Marty, to ensure a long and happy relationship.
Before you start, make sure you've been through our Getting Started guide!
Waking Marty up
Marty’s on switch is on the back, and you can tell if he’s switched on because a white light will appear, as shown below.
If the light doesn’t appear, it might be because the battery is flat or not connected…
A charging cable came with your Marty, that you can use to charge from a USB port. A blue light will turn on when Marty is charging, and off when Marty is fully charged.
Marty can be used while charging, but don't leave it turned on and plugged in or the charger will eventually deactivate, and then Marty will just run out of battery
Low Battery Warning
When Marty's battery starts to run low, Marty will start beeping at you. When the battery gets more flat, Marty will stop moving until charged up again
Enabling and disabling Motors
When Marty is turned on, his motors can be on or off.
A "Get Ready" command will turn all Marty's motors on, and move Marty to his starting position. We'll show you how to send that shortly!
Marty will automatically turn off his motors if he falls over, is picked up, if a motor is overloaded. To turn them on again, just tell Marty to Get Ready!
Using scratch with marty
You've probably already tried out the Scratch programming language. If not, don't worry - getting started with Marty Scratch is super easy!
Click the button below to launch Marty Scratch in a new browser tab
Scratch will take a few seconds to load, then you'll see a splash screen
Click on the "Try It" button to get started!
Next we’ll need to load the Marty extension. Click the blue button in the bottom right corner
Then, click on the Marty the Robot extension
Scratch will scan for Martys, and list any it finds.
Click on the “Connect” button next to your Marty
Connected! Click on "Go to Editor" to begin coding your Marty!
Can't connect to Marty?
First, check your Marty is charged up and turned on!
Next, we'll use the Marty app to check that Marty is connected and working. Download the Marty the Robot app from the app store, and select "Scan for Martys"
If the app shows your Marty:
- Try re-scanning in Scratch, to see if it can find your Marty now
- Check that Marty and your Scratch device are both connected to the same WiFi network
- Click the "Connect Manually" button in the Scratch Marty Scanner, then enter the IP address of Marty, as shown in the app - it'll be something like 192.168.8.42
If the app doesn't show your Marty:
- Check again that Marty is charged up and turned on
- Is a blue light slowly flashing inside Marty? If so, Marty is not connected to your WiFi. In the app, select "Set Up Marty" and follow the instructions to connect Marty to your WiFi network
- Make sure that your app and Marty are both connected to the same WiFi network (or command hub)
Ok! Now we're connected to Marty and ready to program!
One quick rule - always start your code with a "Get Ready" block, to make sure Marty's motors are turned on and he's standing up straight. If your Marty stops moving - ask him to Get Ready!
Let's give it a go!
In Scratch, click together the "When green flag clicked" from the Events section, and the "get ready" block from the Marty the Robot section
Make sure the blocks snap together!
Then, click the green flag to run your code
Your Marty should spring to life and wiggle their eyebrows!
Well done, you've just programmed a real robot!!
Remember, if your Marty's not moving, try a Get Ready block
Now let's get marty moving!
The Get Ready block is just one of loads of Marty blocks!
Let's try a few more out, starting with walking
Add two more blocks to your code, from the Marty the Robot section
Click on the green flag to run this code
What does Marty do?
Marty will carry out the instructions you list, in order from top to bottom!
Let's try changing things a bit, and add the slide and turn blocks too!
Again, click on the green flag to run this code
Challenge: Try more marty moves
Now you've tried out the get ready, walk forward, turn, slide, and wiggle Marty blocks. Cool!
But, there are loads more!
Try out more of the Marty blocks. What can you make Marty do?
Can you make Marty:
- Walk backwards?
- Move their eyebrows?
We've figured out how to get Marty to do things, but how can we be more specific?
What if we want to walk 4 steps instead of 2? What about 5, or 10?
The walk forward block has a number in it, that you can change!
Try changing it to 5, and see what Marty does
This number is called a parameter, and it customises what Marty does.
Let's make Marty kick at the end of the walk. By default, Marty will kick with the left leg, but if we click on that, we can change it to the right leg
The kick block also has a parameter we can change! Instead of being a number, this time it lets us choose to kick with the right or left foot
Challenge: Kick a ball
You've figured out how to get Marty to walk forward by different amounts, and then to kick with either leg. Nice!
Place a ping pong ball about 30cm in front of Marty
Can you make Marty walk to the ball and kick it?
Marty is pretty happy that they've kicked the ball!
Let's make a more elaborate celebration
We're going to add the circle dance block, along with a repeat block from the Control section.
Change the number in the repeat block to be 3
We've also added a stand straight block, and an eyes block to make Marty's eyebrows move wider
What happens when you run this code?
The repeat block acts as a loop - anything inside it is repeated a certain number of times.
Let's change a couple of parameters and see what happens
We've changed the number of circle dances Marty does, and how fast they are!
Challenge: Make your own celebration dance
You can put other blocks inside the repeat loop too! Or change the speed more!
Make your own celebration dance for Marty to do once they score a goal!
You've learned how to program Marty from Scratch!
You've put together sequences of operations, changed parameters, and even made a loop!
- How fast can Marty circle dance?
- Can you change how fast Marty walks?
- Can you make Marty turn faster?
Hint: try this block!
Well Done! You've programmed a walking robot!
Head back to the Home Edu lesson guide to learn how to get Marty to do even more!