This reference describes libraries for writing programs for the GR-ADZUKI board, and HTTP API for controlling a web compiler. Refer to the information below when you start to use GR-ADZUKI for the first time.

About "Arduino-like" Sketches

You can make a code compatible with Arduino.

In Arduino, programs are called "sketches," which is why we have tried to make things easier by calling them "sketches" here as well.

 

Here's a little explanation about sketches. Take a look at the sample sketch below. This is a simple sketch that turns a red LED on the ADZUKI board on.


#include <Arduino.h>
void setup(){
    pinMode(13, OUTPUT);
}
 
void loop(){
    digitalWrite(13, HIGH);
    delay(200);
    digitalWrite(13, LOW);
    delay(200);
}

Arduino requires a unique description -- setup() and loop() -- to be included in the sketch. The setup() function is called only once after reset or power-on. Then, the loop() function is executed repeatedly. For example, the sketch to the right turns the LED on and off the using pinMode(), digitalWrite(), and delay() functions. The pinMode() in the setup() defines which pin to use for driving the LED. Then, the digitalWrite() turns the LED on and off. The delay() defines on and off time. When using the GR-ADZUKI board, always describe #include <Arduino.h>, the library that includes all these Arduino compatible functions, in the first line.

The best thing about Arduino is its plentiful choice of libraries. These libraries make it easy to not only turn on LEDs, but also emit noises, run motors, and connect to networks. Check out the lineup in the LIBRARY tab in the menu above.

About the Pin Layout

The information below describes the pin layout of the GR-ADZUKI board. There are many cases where you use the library with a pin number. For example, the following description:


digitalWrite(2, LOW);

This means to set pin2 to LOW. And, from A0 to A7 can be used to read analog values. For example, the following description:


analogRead(A0);

This means to read from A0 condition. From A0 to A7 are the same as from 14 to 21. Although, LED pins are assigned to 6, 9, 10, 11, 12, and 13, The colors are controlled by pin22(red), pin23(green) and pin24(blue).

Update

March 30, 2018: Updated Serial and Ethernet. Added SoftwareSerial.

Library

You can create a gadget easy with the library. Most of the functions that you want to use are here, such as an ADC, timer, PWM, sound generation, SPI communication, USB virtual COM port, real-time clock, and memory card.


Basic Library

This is basic output of the digital signal, calculation, interrupt. You can use basic library without additional description, #include and instance generation. For example, following description:


#include <Arduino.h>
void setup() 
{ 
  Serial.begin(9600);
  Serial.println("Hello");
} 

The code above can be described in the setup and loop function without additional code.


Standard Library

This is for applied operation, motor control, SPI communication, and memory operation etc. You can use it with additional descriptions. For example, the following description for a servo motor.


#include <Arduino.h>
#include <servo.h> 
 
Servo servo0;
void setup() 
{ 
  servo0.attach(9);
  servo0.write(90);  // set servo to mid-point
} 

This means to attach a servo motor to pin9 and set the angle to 90.

Web Compiler Control API

This API enables the user to control a project from the web compiler using HTTP communications. For example, easily create a program for a smartphone application.

The general flow in using the API is as follows: Get the project or file information in the web compiler, rewrite the specified file, then download the results of the build.

An API key is required to execute this API.

Open the settings page for details concerning the API key.

An error (null value) is returned if an API is executed while another API is already in progress.

Support

Feel free to go to the Renesas Rulz User's Community Site with questions, problems or comments. Other users, both veterans and new users, are there to help!