Instructables

A Gentle Introduction to Arduino for Scratch Users

Picture of A Gentle Introduction to Arduino for Scratch Users
arduino_scratch.jpg
There are lots of people who are very comfortable with the Scratch programming environment but want to try something with Arduino to Blink Lights, Sense Buttons, Run Servos or whatever. They may find the C programming environment in Arduino IDE - Sketch, a bit too much of a step.

This instructable draws on the work of the guys at “Citilab” http://seaside.citilab.eu/scratch .

They have created a modified version of  Scratch to interface with Arduino.

Using Scratch Programs you can make Arduino Flash Lights, Read Buttons, and do many of the things that you can do with the the regular Arduino environment.

So if you like Scratch and Arduino but are not quite ready for C programming (yet), this is something you can try out.
 
Remove these adsRemove these ads by Signing Up

Step 1: You Will Need

Picture of You Will Need
Follow the instructions on this linked page http://goo.gl/4pU2h to download and install :

1.  S4A ( Scratch 4 Arduino) and

2. the Firmware for Arduino to talk to S4A


For our experiment you will need:

* Arduino UNO
* Some LEDs
* A 560 Ohm resistor for each LED  (or a value similar to that)
* A 10k Ohm resistor
* A Pushbutton Switch
* Breadboard for wiring up e.g. (http://goo.gl/1E1iIl)
* Some Wires

Step 2: Flashing LED Experiment

Picture of Flashing LED Experiment
IMG_7422.JPG
IMG_7418.JPG
LED_Button_bb.jpg
LED_Button_schem.jpg
To start we need to wire an LED and Switch to the Arduino (along with some Resistors), as shown in the diagrams below.

We're using the switch in the second experiment and the LED in both the first and second experiments.

Go ahead and wire it up as shown.

Step 3: Scratch Program 1: LED Blinking

Picture of Scratch Program 1: LED Blinking
Blink.png
Startup S4A (Scratch 4 Arduino) and Enter the Scratch program as Shown.

You Should Now See the LED flashing.

If you don't. Check the wiring.

The equivalent C program (Arduino Sketch) is shown below as well.

Compare the C and the Scratch and see if you can figure out what's going on.

Step 4: Scratch Program 2: LED and Button

Picture of Scratch Program 2: LED and Button
ButtonLED_C.png
Now we'll use the button to turn on on the LED when it's pressed.

Enter the Scratch shown.

Compare it to the equivalent C Code in the picture.

Try to Understand how they both work.
Tachyon8 months ago
Great Instructable.
The Arduino / S4A combination is a great way to get non programmers to jump into both programming and interacting with the real world via the Arduino.
gychung8 months ago
Where Can I download S4A ???
excellent!
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!