Posted   —   № 6

Now I’ve got my Marty setup and running I can start programming their actions using the Marty Scratch extension. Awesome!

There are two versions of Scratch developed for Marty, a basic one and an extended one. The first choice I had to make therefore, was which of the two to use.

What’s the Difference Between the Basic and Extended Scratch?

Both versions of Scratch for Marty are very similar, and if you are familiar with one you will have no trouble with the other. The only real difference is that the extended version of Scratch allows users finer control over Marty either through additional coding blocks, or additional variables in the basic blocks. A full breakdown of the blocks in both the Basic and Extended Scratch extensions for Marty can be found here.

I decided to jump straight in and use the extended version of Scratch first. This proved to be a good choice (unlike my idea to make a soufflé at the weekend despite being unable to correctly boil an egg).

Loading ScratchX

There is a comprehensive guide on getting started with Scratch for Marty here.

If your computer is like mine (temperamental) then you may encounter a blank page when you first try to load Scratch. This is because you have not enabled Adobe Flash. Once you do that everything should run smoothly.

Functions in Scratch

The different blocks in Scratch correspond to functions. Personally I found it fun to try out the functions before reading the documentation. However for more cautious people the behaviour each function will produce in Marty, along with the different options each function allows you is documented here.

Running Programs in Scratch

Scratch is a graphical programing language in which you drag and drop “blocks” together to create programs. To run a program you simply double click on the first block of code - it is very intuitive. Scratch have a pdf guide to getting started, which gives more information as to how it runs here but you don’t really need to read that. For a more Marty specific version, Robotical have a getting started with Scratch guide here.

Before doing anything else, it is important that you get Marty ready to respond to any programs you write by running the “Enable Motors” block or the “Get Ready” block. If you don’t, Marty will stay asleep and not respond to any code you try to run (much like people who are asleep fail to respond when you ask them questions).

It is also a good idea to “Turn off motors” if you are taking a break, as this prevents Marty’s battery from running down.

Playing around with Marty in Scratch is great fun. It is easy to get the hang of, but provides scope to build up some pretty complex programs with loops, conditional statements etc. However, after using it for a while I became aware of a few issues or unexpected behaviours. I’ll outline them, as well as how I tried to solve them, in my next post.