Let's Make a gadget with the Renesas GR-SAKURA board!

The Gadget Renesas Project provides the GR-SAKURA board for use with a Web compiler, for easy creation of simple gadgets. The board comes with a microcontroller (MCU),-- that flat black square in the middle of the board--that operates as a mini computer. By programming this MCU, you can make things flash in various colors, produce sounds and melodies, and move objects.

Sketch Reference:

This reference describes libraries for writing program for GR-SAKURA, and HTTP API for controling web compiler. Refer to the below when you start to use GR-SAKURA at the first time.

Note: This reference is for the library version V2.00 or more. In case of V1.xx, refer to here

Arduino Sketches

The GR-SAKURA board and Arduino are fully compatible. Most of the pin layout is the same and libraries are used in almost the same manner. The only key difference is, in Arduino, programs are called "sketches". For simplicity, we call a program a "sketch" for SAKURA as well.

Let us explain a little about how sketches work. The simple sketch to the below makes one LED on the GR-SAKURA board flash.

#include <Arduino.h>
void setup(){
    pinMode(PIN_LED0, OUTPUT);
}

void loop(){
    digitalWrite(PIN_LED0, HIGH);
    delay(200);
    digitalWrite(PIN_LED0, LOW);
    delay(200);
}
    

One unique characteristic about Arduino is that setup() and loop() must be written in the description.
The setup() function is called only once after start up. The sketch to the above is preparing to turn on an LED using the pinMode() library.
The loop() function is then executed repeatedly. The sketch to the above uses the digitalWrite() and delay() libraries to make an LED flash.
Whenever creating a sketch for the SAKURA board, always describe #include <Arduino.h> in the first line.

The best thing about ABC Arduino is its extensive number of libraries. These libraries allow you to do just about anything quite easily, from making LEDs flash, to creating sounds, running motors and connecting to a network. Check out the contents of each library by selecting LIBRARY in the above menu.

About Pin layout

Below describes pin layout of the GR-SAKURA. There are many cases you use the library with pin number.


For example, the following description means to set pin2 to LOW.

digitalWrite(2, LOW);
    

The folllowing description means to read from A0 condition.

analogRead(A0);
    




Made by the Gadget Renesas Project