Overview

This page introduces using the GR-ADZUKI board with Scratch, a visual-based programming tool for kids, which can be used with either Windows or Mac. This example project uses the Scratch derivative solver calculator S4A.

gr-adzuki-sp-scratch-derivative-solver-calculator

Preparation

You will need a GR-ADZUKI board and a USB cable (Micro B type).

gr-adzuki-board
 usb-cable

Protocol

1. Download and Install S4A

Open the S4A site and click on “Downloads.”

 scratch-s4a-site

Download and install S4A on the PC you will be using to create your sketch.

 scratch-s4a-download-install

2. Set GR-ADZUKI Switches and Connect PC

Set the slide switch on the GR-ADZUKI board to “Scratch” as shown in the photo.

gr-adzuki-sp-scratch-switch

3. Startup S4A

Connect GR-ADZUKI to your computer and startup S4A. As soon as S4A is running, it will start looking for GR-ADZUKI and the message “Searching board...” will appear.

gr-adzuki-sp-scratch-s4a-searching

When it finds GR-ADZUKI, Analog0~Analog5, Digital2, and Digital3 will appear on the screen.

If this graphic is not displayed, please confirm the following:

  • Is the GR-ADZUKI slide switch correctly set to Sketch?
  • When using Windows, is the COM port set to number 32 or lower?
    (If it is set to number 33 or higher, you need to use the device manager to set it to number 32 or lower.)
gr-adzuki-sp-scratch-s4a-searched

5. Confirm Illuminance Sensor (Brightness) Operations

Place your hand over the GR-ADZUKI board, as shown in the photo to the right, to make it dark.

gr-adzuki-sp-scratch-s4a-illuminance

As you can see, the larger the value, the brighter the light; and, conversely, the lower the value the darker, or less illumination.

gr-adzuki-sp-scratch-s4a-illumination-value

6. Confirm Button Switch Operations

GR-ADZUKI is equipped with two button switches. Try pressing the switch indicated by the finger in the photo.

 gr-adzuki-sp-scratch-s4a-button-switch

Digital3 changes from false to true. Press the other button switch to see how Digital2 changes.

gr-adzuki-sp-scratch-s4a-button-switch-t-f

Flash LED

Let's experience Scratch programming. Try flashing an LED on GR-ADZUKI. Click the "digital 13 on" block to the left side of the screen.

 gr-adzuki-sp-scratch-s4a-digital-on

LED 13 flashes as shown here.

 gr-adzuki-sp-scratch-s4a-led13

Arrange the blocks as shown here and then click "forever" to run. The LED blinks.

gr-adzuki-sp-scratch-s4a-led-forever

When it Gets Dark, the LED Flashes

Next, let's try using a conditional statement to do XX when OO occurs, and let the LED flash when it gets dark. Arrange the blocks as shown in the screen shot.

gr-adzuki-sp-scratch-s4a-led-flash-dark

When holding hands and darkening, LED 13 flashes.

gr-adzuki-sp-scratch-s4a-led13-flashes

Change a Costume

Let's make the PC screen a little more fun at the end by editing the costume. Open the Costume tab and click the Edit button as shown in the screen shot.

gr-adzuki-sp-scratch-s4a-costume-edit

Once you delete the costume, click the Clear button.

gr-adzuki-sp-scratch-s4a-costume-erase

Click the Import button.

gr-adzuki-sp-scratch-s4a-costume-import

We're selecting a dog here. Click the OK button. By the way, I selected this sprite because I wanted to walk the dog after this.

gr-adzuki-sp-scratch-s4a-costume-dog

To make another costume, click the Copy button.

gr-adzuki-sp-scratch-s4a-costume-copy

Since the costume is duplicated, click the Edit button to load another sprite.

gr-adzuki-sp-scratch-s4a-costume-edit2

Open the Script tab and add three blocks to the LED Flash sample as shown in the screen shot. The costume changes only when you hold your hand over the GR-ADZUKI board; the sprite will move. It appears to be walking when you choose a dog.

gr-adzuki-sp-scratch-s4a-led-script-tab

 gr-adzuki-sp-scratch-s4a-dog-walking

Example

As Scratch programming is quite simple, I won’t go into a detailed explanation here. But, I would like to offer one simple example.

Using the brightness sensor, this example creates a fire-breathing dragon when a hand is held over the GR-ADZUKI board. To view the example, download the following file and read it using S4A, then press the green flag.

A screen image is shown to the right.

gr-adzuki-sp-scratch-s4a-dragon

Restoring the S4A Firmware

After overwriting the GR-ADZUKI firmware with an Arduino Sketch, you will need to restore the firmware to use S4A again. To restore the firmware, store the following bin file in GR-ADZUKI. For instructions on how to write the file to GR-ADZUKI, refer to the Sketch Using a Web Compiler project.

  • Click the following link to start downloading the file, and decompress the file after the download is complete.
    S4A Firmware (ZIP)