Installing Scratch for the Arduino
A short while ago I raised an article covering the installation of Scratch which is a great developer application for the young but there is another more interesting developers tool equally with the young in mind, it is called "Scratch 4 Arduino" or "S4A" for short. One of the best things about this particular development application is that it is special to the Open Source Arduino board, which if you didn't already know is a way to interface real world projects to that of your own home produced software.
Arduino objects offer blocks for the basic microcontroller functionalities, analog and digital writes and reads, and also for higher level ones. You can find a block to manage Parallax continuous rotation servomotors.
Creating Arduino objects is available in 3 different ways as in the Scratch environment. You can choose between creating a new connection or using an already created one. This feature allows Arduino virtual objects work collaboratively using the same connection (the physical object). The Arduino object will find the usb port where the board is connected.
S4A interacts with Arduino sending actuators state and receiving sensors state every 75 ms, therefore the width pulse has to be greater than this time period. This information exchange is done using the PicoBoard protocol and there has to be a specific program (called firmware) in the board. You´ll find instructions to upload it through the Arduino environment.
In this article we will explain how to install "Scratch 4 Arduino" even though you may not own or be part of the "Raspberry Pi" community you can still enjoy, participate and more importantly collaborate with the more exciting world of robotics and that of the Arduino.
"Scratch 4 Arduino" is not supplied on the "Raspberry Pi" but it could be installed adding another layer of functionality. It like the Scratch application is available in a variety of system formats well three anyway these include the Mac and Windows platforms, it is an example of development across platforms where the platforms can be Mac, Windows, Raspberry Pi(Strictly speaking the Raspberry Pi is not an Operating System) and Linux. For the purpose of this article we will assume that you wish to install the Scratch 4 Arduino application onto a Ubuntu or Debian build operating system. Although if you visit the following site you will detailed instructions to install Scratch 4 Arduino onto almost any current Operating System.
Scratch 4 Arduino download
In addition you need to download the firmware for the board and the Arduino Integrated Development Environment or Arduino IDE but I will run through a howto for these, you will also need an Arduino board that is supported by the Arduino IDE, most any Arduino will do plus a serial USB type 'A' to serial USB type 'B'. There is no additional requirement for power the device once connected will obtain the power it need through the USB Cable.
Unfortunately Scratch itself doesn't as far as I am aware support plugins that can be utilised to attach to external devices, hardware devices such as the Arduino or Midi devices, it would be nice if they did but perhaps someone can suggest it. Therefore a special variant has been created called Scratch 4 Arduino or S4A an adaptation of the original Scratch program. Again this is currently not available in either the Debian or Ubuntu repositories. However even though Scratch 4 Arduino is not within either of the vast program application stores it can still be installed.
Scratch for Arduino Installation
First we need to install and configure the Arduino IDE this we can obtain from the repositories without much effort at least on Ubuntu and Ubuntu variant systems, execute these commands in the order they are presented via a new terminal window. You will also need the Arduino board itseld along with its data cable connect this to a USB port on the computer before you start Arduino IDE application.
Just in case of any dependicies that need be installed which you are not aware of.
With the Arduino board connected to your computer run the Arduino IDE for the first time you will be asked to make group changes so the Arduino can communicate via a USB or Comms port. Accept whatever changes are presented then reboot your computer for the changes to take effect.
I might be wrong here but it seems at least on my setup that the menus have blended with the background surface making it very difficult to read, move your mouse pointer over the toolbar where there should be menus and the menus should reveal themselves if you have the same problem I do.
Run again the Arduino IDE application from the menu there should be no errors
At this point you will need to install the firmware to the Arduino board but first we need to obtain it. You can as always obtain the latest firmware downloads from Arduino Communication Firmware download page
Close all Arduino IDE programs on your desktop and locate with the file manager the file you have downloaded from the site. Open the file with a double click of the mouse or select open whichever you find easier. This should initialise one instance only of the Arduino IDE so please make sure only one instance is on your desktop. Upload your firmware to the Arduino board using the arrow pointing right rather than up or down.
Now we need to install Scratch 4 Arduino which hopefully you have already downloaded from the link at towards the top of this page. If you have provided and installed the firmware for the Arduino the IDE can now be closed. If you have not downloaded the Scratch 4 Arduino please do so now using the link provided below.
Scratch 4 Arduino download
In it's current format and at the time of writing this article "Scratch 4 Arduino" is in it's stable Version number "1.4". In the main there are some three different installation options available for the Mac, Windows and of course Debian 32bit. We for the purpose of this article will concentrate on Debian 32bit.
Select the download link you choose for a Debian installation and save to a folder in your own Home/Downloads area or folder of your choice. It's not strictly necessary to save the file to folder as you can install using the Ubuntu Software Centre, however to install this way takes ages and better in our view to install from the command line here's how.
First startup a new terminal and change the directory using cd to the location of the file you downloaded.
The later command completes any dependencies required to finish the installation. You can now run the Scratch application, if your new to Scratch we suggest you look and install some of the suggested examples available when you open an existing project, just select the example button on the left. We also recommend you visit a site called