Gadget Renesas

Linking Ideas and Electronics

アイテム

GR-SAKURA Special Page

Sketch on Web Compiler

Overview

This page introduce how to sketch on Web Compiler for GR-SAKURA. Both Windows and Mac are availbale.

Preparation

GR-SAKURA and USB Cable(mini B type)

login login

 

Procedure

1. Login to Web Compiler

Login to Web Compiler from the top page of GADGET RENESAS.
When you click the below image, the page is displayed on other tab page.
Then click [Log In] or [Guest Log In]. If you chose the guest login, your sketch is removed when log out.

login


Fill with your MyRenesas account and click [Sign in], when you entered from [Log In].

login



2. Create a New Project

To create a project, click the button as below. If you log in at the first time, skip this procedure.

login


Select an appropriate template, such as GR-SAKURA_Sketch_Vxxx.zip, where xxx indicates the version.

login



3. Displaying your sketch

Selecting the "Create Project" brings you to the Web Compiler IDE window. Click "gr_sketch.cpp" file under the explore menu. The source code of the file will appear in the right window. This is the sample code that will drive the LED on GR-SAKURA.

login



4. Build the code

Since the code shown on the screen is a working sample, you don't need to debug the code. To build the code, click the "Execute Build" icon on the right navigation menu shown below. This should show you "The Compilation Is Complete" pop-up.
Note that it takes a little time to build at the first time because of compilation of all source files.

login


When the build is OK, the pop-up screen shows "Make process completed" at the bottom of screen. Then click the close button.

login



5. Download the sketch

When the build is successfully completed, Web Compiler creates binary file "peach_sketch.bin" under the .CPP file shown below. Move the mouse onto the bin file and click the right click - that shows the pop-up menu below. Then click "Download" menu.

login



6. Connect GR-SAKURA

Connect GR-SAKURA to PC with USB cable. And then push the Reset button on GR-SAKURA. GR-SAKURA is displayed as a USB storage.

login



7. Flashing (Copy program to GR-SAKURA)

Copy & Paste the sakura_sketch.bin to the storage. Now the LED on GR-SAKURA is flashing, isn't it?

login



 

Sample Code for LED flashing like Hotaru insect

Try the below sample to copy & pase your sketch on Web compiler.

#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