HOW TO: USING LEGO WEDO WITH SCRATCH

  • programming LEGO WeDo in Scratch

LEGO Education WeDo is counted among the best tools for teaching robotics to children aged 7 to 9. Currently, this set is available on the market in two versions: the “classic” LEGO WeDo from 2009 and its newer version, WeDo 2.0 from 2016. Each set includes a unique assortment of LEGO bricks and several electronic elements: one motor, two sensors and a hub that connects your construction with a computer, or a tablet. Interestingly, it’s the programming software designed for these sets that seems to be the weakest point in this system. The first set comes with a high-quality, but paid software, while the other relies on a free software, but with several shortcomings. Not everyone is aware that an alternative exists – these sets can also be programmed in the internationally known and esteemed Scratch programming language, enjoyed by teachers and students alike. If you want to learn how to start working with WeDo and Scratch simultaneously, read on.

Scratch is a visual programming language often used for educational purposes. Children as young as 8 years old use it to create games, animations, or interactive forms. Programming in Scratch actually means connecting colorful blocks that contain programming commands. Children connect these blocks intuitively and test which connections work – just like when building with LEGO bricks. Thanks to this method, simple programs are created almost organically and each program becomes an inspiration for the next one.

GETTING STARTED WITH SCRATCH

Scratch 2, the most recent version of the software, can be used in two different ways. When using the online version, accessible with the most popular web browsers, you can access Scratch without the need to install anything on your hard drive. You can also choose the offline variant – all you need to do is download it from the official Scratch site and install the software. The second option requires administrative privileges, but we highly recommend it for classroom activities and if you have issues with unstable internet connection. Fans of ye ole Scratch can still use the 1.4 version, but it’s available only offline – you can download it here). It is worth noting that Scratch 1.4 can be installed on the same computer alongside Scratch 2. This solution is especially helpful if you already have a lot of materials for the older version. Despite similar mechanisms, the two Scratch versions significantly differ in graphic design and have several disparate blocks. Therefore, if you plan on using older materials, you should install the appropriate software to avoid unnecessary chaos in class. Presently, all versions of Scratch are available only on PCs. News about a special version for tablets reappears now and then, but so far, it hasn’t left the future prospects category.

If you need some assistance with running one of the above versions of Scratch for the first time, you will find detailed instructions on how to install and run this software below. If you already know how to use Scratch and are eager to find out how to program LEGO WeDo with it, proceed to the WeDo Extension in Scratch section.

Click on the topic to expand step-by-step instructions.

1. When working online with Scratch, there’s no need to install it, just go to www.scratch.mit.edu. You can change your language preferences by using the drop-down list at the bottom of the page.

Scratch 2 online install

2. To begin programming, click the Create button – it opens the editor and automatically creates a new project. If you have problems displaying the editor, you probably lack the latest Adobe Flash Player plugin. You can download it here. Remember you need administrative privileges to install it.
Scratch 2 online install

3. Now you can see the Scratch environment, ready for your newest project. You can program games and animations by connecting blocks from the basic menu. If you want to use Scratch for controlling LEGO WeDo robots, go to the WeDo Extension in Scratch section.

Scratch 2 online install

 

1. To work with the offline version of Scratch 2, you must download and install a suitable app on your computer. The most recent version of the app, 2.0, can be downloaded for free here: scratch.mit.edu/scratch2download/. You need administrative privileges to install it.

Scratch 2 offline install

2. The Scratch app relies on Adobe AIR (Adobe Integrated Runtime). In case you haven’t installed it on your computer yet, you can download it either from the Scratch website, or from the producer’s site, available here. Select the right version for your operating system, then download and install the plugin.

Scratch 2 offline install

3. Once you’ve installed the plugin, proceed to downloading Scratch. Select the right app for your operating system and install it on your computer.
Scratch 2 offline install

4. At this point, you can run Scratch offline and start programming games, or animations, by using the standard block selection included in Scratch. You can change your language preferences by clicking the globe icon, located in the taskbar. If wish to use Scratch for controlling LEGO WeDo, proceed to the WeDo Extension in Scratch section.

Scratch 2 offline install

If you wish to, you may also use the older version of Scratch. The version 1.4 looks slightly different than its successor. Particularly dissimilar are the arrangement of the Stage and the Sprite Panel in comparison to the other interface elements; the colors are distinctive as well. Therefore, if you’re using materials created with the older version of Scratch in mind, you should use the fitting software version. Scratch 1.4 is available only offline.

1. To install Scratch 1.4 on your computer, go to scratch.mit.edu/scratch_1.4/.
Scratch 1.4 install

2. Download and install the right software version for your operating system. If you are using Mac OSX, download the software from the first link on the page (MacScratch1.4.dmg). If you have Windows operating system in version 2000, XP, Vista, 7, or 8, download the software by using the second link (ScratchInstaller1.4.exe). If you are using Debian, or Ubuntu operating system in the 12.04 version, or a newer one, click on the third link available (you can use Software Center or install the program manually, by using the link below).

Scratch 1.4 install

3. With the installation complete, you can run Scratch 1.4 on your computer and start programming with the standard Scratch blocks. If you’d like to control LEGO WeDo through Scratch (note that Scratch 1.4 is compatible only with WeDo 1.0!), proceed to the WeDo Extension in Scratch section.

Scratch 1.4 install

 

WEDO EXTENSION IN SCRATCH

To start programming LEGO WeDo robots through Scratch, it is necessary to expand the selection of Scratch blocks by those included in the WeDo extension. Depending on the set at your disposal, you will need either the WeDo 1.0 extension, or the WeDo 2.0 extension. If you plan to alternate between sets, you should install both extensions. In Scratch 2, both LEGO WeDo extensions can be installed at the same time. When using Scratch 1.4, you can either content yourself with managing only WeDo 1.0, or upgrade your software to Scratch 2. The extension blocks allow you to manipulate WeDo motor and sensors, which means your code can step beyond the computer screen.

WEDO 1.0 AND SCRATCH

Connecting LEGO WeDo 1.0 with Scratch is somewhat easier compared to the newer version. When you connect the hub via USB, the software detects it automatically. Scratch 2 contains the LEGO WeDo extension in its both versions: online and offline. The older version of this software – Scratch 1.4 – can also be used with WeDo 1.0.

Click on the topic to expand step-by-step instructions.

In order to program LEGO WeDo 2.0 robots in the Scratch 2 online development environment, you must have the Scratch Device Manager installed. To achieve this task, you must have administrative privileges on the computer you’re using.

1. Go to the scratch.mit.edu/wedo/ website.
Scratch 2 WeDo 2.0 extension

2. Select the right version for your operating system. The app works only on Mac OSX and Windows 10 (or newer) operating systems. Download the installer, then install the Scratch Device Manager on your computer. After successful installation, run the app.

Scratch 2 WeDo 2.0 extension

3. The next step is to pair your computer with the WeDo 2.0 hub via Bluetooth. LEGO WeDo 2.0 set (#45300) relies on Bluetooth Low Energy (BLE) technology to connect the device with the computer. If your machine does not support this technology, you should add a Bluetooth adapter to your shopping list. Although it is not included in the set, its producer, LEGO Education, recommends to use the Bluegiga BLED112 dongle. More information on this topic is available in our in-depth review of the LEGO WeDo 2.0 set. To pair your computer with the Smart Hub WeDo 2.0, you need to access your Bluetooth settings (in Windows, you can just type “Bluetooth” in the search bar).
4. Turn the Bluetooth on by selecting the appropriate option in the Bluetooth settings. Next, grab the Smart Hub WeDo 2.0, then press and hold the green button on top (before you try this, make sure the batteries inside are charged). On the list of all Bluetooth devices available, a “LPF2 Smart Hub 2 I/O” should appear – that’s the Smart Hub WeDo 2.0 (you can change its name later). Click its name on the list to pair the device with the computer.

Scratch 2 WeDo 2.0 extension

5. Run Scratch 2 online.
Scratch 2 WeDo 2.0 extension

6. Go to the More Blocks category, then click the Add an Extension button.

Scratch 2 WeDo 2.0 extension

7. From the list of all extensions available, select LEGO WeDo 2.0 and click OK.

Scratch 2 WeDo 2.0 extension

8. After successful installation, the LEGO WeDo 2.0 tell-tale should be yellow, or green in color. Yellow means that the device is not connected to the computer, or that it cannot be detected. Connect your hub to the computer.
Scratch 2 WeDo 2.0 extension

9. Go to the Scratch Device Manager, click Connect, then press the button on the Smart Hub WeDo 2.0. Once the hub is detected, the app will connect the computer with the device. If all actions were conducted correctly, the tell-tale informing about the device status should change to green. Now you can start programming LEGO WeDo 2.0 robots with Scratch.

Scratch 2 WeDo 2.0 extension

In order to program robots created with LEGO WeDo 2.0 in the Scratch 2 offline programming software, you need to install the Scratch Device Manager, just like with the online version. To do it, you must have administrative privileges on the computer you wish to use. You can install the Device Manager by following steps described in the How to add WeDo 2.0 extension to Scratch 2.0 online section. However, in step 5, run the Scratch 2 app installed on your computer, instead of the one available online.

If you want to use the online Scratch version to program WeDo robots, you must add the relevant extension and install a plugin, which will allow your browser to control the set connected to the USB port of your computer. Therefore, preparing the computer room for programming WeDo robots in Scratch requires administrative privileges, regardless of whether you want to use the offline, or the online version.

1. To add WeDo 1.0 extension to Scratch, go to the Scratch editor. In the blocks panel, click the More Blocks category and press the Add an Extension button.

Scratch 2 online WeDo extension

2. In the library, select the LEGO WeDo 1.0 set and confirm your choice by clicking OK.

Scratch 2 online WeDo extension

3. After adding the extension, an alert will pop up in the editor. It will inform you about the necessity to install additional plugin. Click OK to close the message.

Scratch 2 online WeDo extension

4. As soon as you close the window, Scratch will open a help panel with information on installing extensions. Click the link on the very end: LEGO WeDo 1.0 or Picoboard Setup.

Scratch 2 online WeDo extension

5. Time to select the appropriate plugin. Your choice will depend on the operating system (Windows or Mac) of the computer and the web browser you use for working with Scratch online. If you use Windows and a web browser other than Chrome, download and install the Windows (other browsers) plugin. If you use Mac OS and a web browser other than Chrome, download and install the Mac (other browsers) plugin. If you use Chrome, you need to install two plugins. Windows users should download Windows Chrome and helper here, while Mac users should select Mac Chrome and helper here. Install the appropriate plugin(s) on your computer.

Scratch 2 online WeDo extension

6. Now you can use Scratch to control your WeDo 1.0 robots. Familiarize yourself with the new blocks. Also, note the tell-tale on top of these blocks: the green color signalizes that the software detected a WeDo 1.0 set connected to the USB port; the yellow color informs that the hub is not connected to the computer; the red color means that the plugin for detecting the device was not installed and Scratch cannot determine whether WeDo Hub is connected, or not.

Scratch 2 online WeDo extension

Adding the WeDo 1.0 extension to the offline software is easier, as the extension is installed together with the entire program. So by “adding” the extension, you simply gain access to the part of the software that was already installed.

1. To display the blocks used for controlling WeDo 1.0 elements in Scratch 2 offline, run the app, go to the More Blocks category and choose the Add an Extension option.

Scratch 2 offline WeDo extension

2.  In the library, select the LEGO WeDo 1.0 set and confirm your choice by clicking OK.

Scratch 2 offline WeDo extension

 

3. And that’s it – you can already use Scratch to control LEGO WeDo 1.0 robots. Familiarize yourself with the new blocks. Also, note the tell-tale on top of these blocks: the green color indicates that a WeDo 1.0 hub is connected to the USB port; the yellow color informs that the set is not connected to the computer.

Scratch 2 offline WeDo extension

Adding WeDo 1.0 Extension to Scratch 1.4 is equally easy. Again, the extension is installed together with the software, but the additional blocks are hidden by default. By “adding” the extension, you simply uncover them.

1. Open Scratch 1.4, click Edit in the taskbar, then select the option Show Motor Blocks.

Scratch 1.4 WeDo 1.0 extension

2. In the Motion category, new instructions for controlling LEGO WeDo motors and sensors will appear. Connect the hub to the USB port and start programming robots!

Scratch 1.4 WeDo 1.0 extension

EXAMPLES OF USE

If you wish to learn how to program LEGO WeDo robots in Scratch, try our RoboCAMP lesson plans. Every lesson plan intended for working with LEGO WeDo contains 12 robots in two versions: WeDo 1.0 and WeDo 2.0, together with programming instructions for WeDo Software and for Scratch. Create a free demo account for access to complete materials to the “Biplane” LEGO WeDo lesson (and much more!).

The short instructions below illustrate how you can use Scratch to program one of the most popular and interesting robots of the LEGO WeDo 1.0 set – the Hungry Alligator. To create the alligator, use the building instructions available together with the WeDo software, or on the producer’s website.

Having built the construction, you can proceed to programming. The objective of the code is to allow the alligator to catch the unwary prey that appears nearby its jaws (alligators can be very patient by nature). The instruction provided below shows you how to program the alligator in Scratch 2, step by step. Click “+” and “-“ buttons to move between the slides. Click anywhere on the picture to play the animation. Have fun!

By | 2018-06-20T21:08:04+00:00 February 28, 2017|