Gadget Renesas

Linking Ideas and Electronics

Item

GR-CITRUS Special Project

Sketch with Web Compiler

Overview

This article describes how to create an Arduino sketch (program) using the GR-CITRUS board. The main tool used to create sketches, Renesas Web compiler, is compatible with Windows and Mac.

Preparation

You will need a GR-CITRUS board and a USB cable (micro B type).

login login


 

Protocol

1. Login to the Web compiler

Login to the Web compiler from the GADGET RENESAS top page.
Click the link shown below to open the top page in a new tab.

login


Enter your MyRenesas account information and press the Sign In button.

login



2. Create a project

Use the buttons shown below to create a new project. Skip this step if this is the first time you are logging in.

login


As shown in the following window, select GR-CITRUS_Sketch_xxx.zip (xxx indicates the version), assign any project name you like, and press the Create Project button.

login



3. Sketch display

The Create Program window is displayed as follows. Double-click gr_sketch.cpp in the Explorer navigation bar on the left side of the window to display your program.
What you see displayed is the sketch (program) that will run GR-CITRUS.

login



4. Build the sketch (compile the program and create a write file)

This window is where you will write programs. A sample program has already been completed for you that turns on the LED located on the GR-CITRUS board.
First click the Execute Build button in the right navigation section. The build is successful when the following message is displayed: “The compile was successful.”
Note: The first build after creating a project takes a little longer than normal, because all of the files are being compiled.

login


The results of the build are displayed as follows. If the build is successful, the following message is displayed: “Make process completed.” Click the Close button to close the window.

login



5. Download the sketch (save the file to be written to the computer)

When the build is successful, a citrus_sketch.bin file is created. Right-click on this file name to open the pull-down menu. Select Download to download the file to your computer.

login



6. Connect GR-CITRUS and computer with USB cable

Next, connect the GR-CITRUS board to your computer with the USB cable. After connecting the two, press the Reset button. The GR-CITRUS board will be recognized as a USB memory.

login



7. Write and run sketch

Copy and paste the citrus_sketch.bin file you downloaded to your computer. After the sketch is written, the LED will turn on.

login



 

Make the sample LED flash like a firefly!

The following sample makes the GR-CITRUS LED flash softly like a firefly. Copy the sketch to the Web compiler and give it a try!

#include <Arduino.h>

void setup(){
}

void loop(){
	
	for(int i = 0; i < 256; i++){
		analogWrite(PIN_LED0, i);
		delay(5);
	}
	
	for(int i = 0; i < 256; i++){
		analogWrite(PIN_LED0, 255 - i);
		delay(5);
	}
}
     

share