GR-ADZUKI Special Project
Have fun with Scratch (S4A)!
This article introduces a little bit of fun using GR-ADZUKI with Scratch, a visual-based programming tool for kids, which can be used with either Windows or Mac.
This sample uses the Scratch derivative solver calculator “S4A”.
You will need a GR-ADZUKI board and a USB cable (micro B type).
1. Download and install S4A
Open the S4A site and click on “Downloads.”
Download and install S4A on the PC you will be using to create your sketch.
2. Set GR-ADZUKI switches and connect PC
Set the slide switch on GR-ADZUKI to “Scratch” as shown in the photo.
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, as in the photo.
When it finds GR-ADZUKI, Analog0～Analog5, Digital2, and Digital3 will appear on the screen, as seen in the photo.
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.)
5. Confirm illuminance sensor (brightness) operations
Place your hand over GR-ADZUKI as shown in the photo to make it dark.
As you can see, the larger the value, the brighter the light and, conversely, the lower the value the darker, or less illumination.
5. Confirm button switch operations
GR-ADZUKI is equipped with 2 button switches. Try pressing the switch indicated by the finger in the photo.
Digital2 changes from false to true. Press the other button switch to see how Digital3 changes.
Let's experience scratch programming. Try flashing LED on GR-ADZUKI. Click "digital 13 on" block to the left as in the photo.
LED 13 flashes as following.
Arrange blocks as followings and then click "forever" to run. LED blinks as you can see.
When it gets dark, LED flashes
Then, let's try using a conditional statement to do XX when OO ocurs, and let the LED flashs when it gets dark. Arrage blocks as seen in the photo.
When holding hands and darkening, LED 13 flashes.
Have fun to change a costume
Let's make PC screen a little more fun at the end. Let's edit the costume. Open the Costume tab and click the Edit button as shown in the screen below.
Once you delete the costume. Press erase button.
Press import button.
Selecting a dog here. Press OK button. By the way, I selected this sprite because I wanted to walk the dog after this.
Making another costume. Press copy button.
Since the costume is duplicated, press the edit button to load another sprite.
Open the Script tab and add three blocks to the LED Flash sample as shown below. The costume changes only when you hold your hand, and the sprite will move. It seems like walking when you choose a dog.
As Scratch programming is quite simple, I won’t go into a detailed explanation here. But I would like to offer one simple sample.
Using the brightness sensor, this sample creates a fire-breathing dragon when a hand is held over the GR-ADZUKI board. To view the sample, download the following file and read it using S4A, then press the green flag.
Click the following link to start downloading the file.
The following is a screen image.
Restoring S4A firmware
After overwriting GR-ADZUKI firmware with an Arduino sketch, you will need to restore the firmware to use S4A again. To do so, store the following bin file in GR-ADZUKI. For instructions on how to write the file to GR-ADZUKI, refer to 3. Sketch with compiler.
Click the following link to start downloading the file, and decompress the file after the download is complete.