CAS Community   >   Resources   >  

Programming an Arduino Esplora to interface to Scratch

This program can be used to make an Arduino Esplora act like a PicoBoard.

John Bracegirdle

Created by John Bracegirdle
last edited Aug 27 2013 by John Bracegirdle

Why use this program

This program can be used to make an Arduino Esplora act like a PicoBoard. It can be re-programmed, and has all the capabilities of both the Arduino and PicoBoard. This allows students to start learning using Scratch and develop into the full Arduino system. This can also be purchased for about the same price or less than the PicoBoard.

Level: Intermediate/Advanced

Teaches: Physical Computing, Sensors, Interfaces, Scratch, Arduino

How to use this program

  1. Download & install Arduino software.
  2. Download & install the ScratchSensors library. Download the ZIP file. Then extract and copy it to your Arduino Libaries folder (in windows this is in C:\Program Files (x86)\Arduino\libraries).
  3. Download the Esplora program from this page, and open it with the Arduino program.
  4. Program the Esplora board (press upload in the Arduino program).
  5. The board can now be used with Scratch like a PicoBoard.
  6. The sensors can be found at the bottom of the “Sensing” blocks in Scratch.

Adapting this program

The program maps the accelerometer to resistance A and B, and the joystick to resistance C and D. This can be changed to other inputs by changing the code.

The accelerometer and joystick send the data to Scratch using positive and negative numbers (using two’s complement). Scratch interprets the numbers as all positive, so some Scratch code is needed to convert these into negative numbers. I have included an example of the Scratch code as a file.

Using this program on other boards

I chose the Arduino Esplora as it has the sensors built-in. You can use other Arduino compatible boards with the ScratchSensors library. You would have to create your own sensors, but that could be part of the learning.

Downloaded 1010 times.


This resource has attached files: to access these files, please tick the box below to assent to the license terms
License: The resources on CAS website are under Creative Commons Attribution-Share Alike 3.0 licence unless otherwise specified by the resource creators.

You must confirm that you have read and agree the licence's ToS before you can download the attachments of this resource.

I have read the licence agreement of this resource and agree to abide by its terms and conditions.

Feedback and Comments

Available when logged in (join via the front page, for free):
  • View 2 comments on this resource.
  • View resource history, links to related resources.
  • Leave feedback for the author(s), or help by editing the resource.