Intro to Marty the Robot
what you will need
- A device with our Marty the Robot v2 app downloaded and up to date
- Marty the Robot v2
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 can be found on the back along with some useful lights to let you know if Marty is already connected to a device or if Marty needs to be charged.
You can check the getting started guide that came with Marty to remind yourself what the different lights mean!
A charging cable came with your Marty, that you can use to charge from a USB port. A flashing blue light will turn on whilst Marty is charging and will turn into a solid blue light once 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, the lights on the back will begin to turn from green to red as you start to run out of charge.
Using scratch with marty
You've probably already tried out the Scratch programming language. If not, don't worry - getting started with Marty using Scratch is super easy!
Open up the Marty the Robot v2 app and follow the instructions there to connect your robot to the app. Then click on Code with Scratch to open a new Scratch project ready for coding,
Ok! Now we're connected to Marty and ready to program!
One quick rule - always start your code with a "Get Ready" coding block, to make sure Marty is standing up straight with all the motors are turned on so we are ready to start moving. If your Marty stops moving - ask them 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 Motion 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 the many coding blocks we can use to get Marty moving!
Let's try a few more out, starting with walking and dancing...
Add two more blocks to your code, from the Motion section. Make sure they are green with a Marty icon at the start like below,
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 by adding in some instructions to slide and turn! These coding blocks can be found in the Motion section,
Again, click on the green flag to run this code and see what happens!
Challenge: Try more marty moves
So far you have tried out the get ready, walk forward, turn, slide, and dance blocks to move Marty. Cool!
But, there are loads more!
Try out more of the Marty blocks that you can find in the Motion section. What else can you make Marty do?
Can you make Marty:
- Walk backwards?
- Move their eyes?
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 the word left, we can change it to the right leg
The kick coding 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 code Marty to walk to the ball and kick it?
Hint: You might need to test out how many steps it will take to reach the ball!
Marty is pretty happy that they've kicked the ball!
Let's code a fun celebration dance!
We're going to add the circle dance block from Motion, along with a repeat block from the Control section.
Change the number (the parameter) 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 movements, 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 Education Course homepage to try another coding challenge!