Getting Started with Scratch

Whether you've never programmed before, you're a Scratch wizard, or even if you're a seasoned professional programmer looking to have fun - it's easy and fun to program Marty in Scratch.

Note: your Marty must be connected to your WiFi to program with Scratch. If you haven’t already done it, visit the WiFi setup guide.

First off, turn on your Marty and open up ScratchX:

When scratch loads, you’ll see a warning that looks like this:

That’s because scratchx is experimental, you can just click the green “I understand” button to continue.

Scratch uses Adobe Flash, so if you don’t see anything but the scratch homepage, make sure you’re using a web browser that supports Flash, and that Flash has permission to run.

Our Scratch extension will now scan for Martys.

Ad blockers sometimes get in the way of this, so if you’re having trouble finding your Marty try disabling your ad blocker

There are two parts to the Marty ScratchX extension, the scanner and the main Marty extension itself. Each one had a little coloured circle that shows its status, as shown in the picture above.

For the Marty Scanner

  • Green: Finished scanning, found at least one Marty
  • Yellow: Still scanning
  • Red: Finished scanning, couldn’t find any Martys

You don’t need to wait for scanning to finish before you can start using your Marty. As soon as the scanner finds a Marty it will select it, and the status indicator for the Marty Scratch extension will turn green, as shown here:

For the Marty Scratch Status Indicator

  • Green: Connected to a Marty
  • Yellow: Not yet connected
  • Red: Something has gone wrong! Try a different browser

If all goes well, after a few seconds the status indicator will turn green - that means it’s found a Marty. Yay!

If you have more than one Marty

If you’ve got more than one Marty connected to your network, you can select it from the dropdown list once the scanner has found it:

You’ll need to double click on the “Select Marty” block to activate that Marty, once you’ve selected it from the list. It’ll glow yellow for a second when run

If the Marty Scanner didn’t find your Marty

If the scanning has finished, but didn’t find any Martys, the status indicator will turn red. A standard ScratchX message will pop up saying See the tips window (on the right)…”, but that won’t help us here

If the scanner didn’t find your Marty

  • Make sure Marty is connected to the same wifi network as your computer, and is charged up and turned on
  • Use a browser like Firefox or Chrome for best results.
  • You can double click the “rescan” button to try scanning again
  • You can Find the IP address of your Marty using the instructions here, and then put that into the “Add Marty by IP” block in the Marty Selector. Once you’ve typed Martys IP in, double click it, and it should connect to your Marty!

Try some blocks

Now that we’re up and running, it’s time to have a play around!

Scratch is great because you can program just by clicking and dragging blocks to form programs.

The Get Ready block turns on Marty’s motors, returns Marty to a normal standing position and does a little eyebrow wiggle.

The walk blocks will make Marty walk, and the wiggle block will make Marty wiggle. It’s all terribly complicated

There are a few things to remember about Marty though:

  • Marty’s motors are turned off by default. Before you can send move commands you’ll need to enabled them. That’s done either by using the Get Ready block (which’ll also get Marty standing straight and wiggle his eyebrows), or using the Enable motors block (which will just get the motors ready to receive instructions)
  • Marty has a few safety features to protect him from harm. These include Fall Protection and Motor Protection:
    • Fall Protection: If Marty thinks he’s falling over, he’ll turn off his motors
    • Motor Protection: If there’s too much load on a motor, that motor will turn off

    If your Marty ever refuses to do what you want - it might be that he’s trying to protect his motors! Both of these safety features can be turned off, but we’ll get to that later…

  • Marty likes to be comfortable. At the end of a script, he might adjust his position a bit to take the load off his motors - otherwise he’ll get tired. He also gets bored, and every minute or so he might do a little movement.

So, give it a go! Drag some blocks out and run them (Use an Event block, or just double click them) to get Marty to move!

What now??

Well, have a play around!

Some ideas to get you started are in a PDF here

You can go to docs.robotical.io/scratch for detailed info on everything you can do with Scratch, and links to some more advanced interfaces!

Head back to the Scratch page for examples and activities