Gadget Renesas

Linking Ideas and Electronics

アイテム

GR-SAKURA Special Page

Sketch on IDE for GR

Overview

Introducing the way to sketch on IDE for GR like Arduino IDE. Once download IDE for GR, you can sketch off-line.

login

Preparation

Hardware

GR-SAKURA and USB Cable(mini B type)

login login

Software

Download IDE for GR. In case of Windows, decompress the zip file. In case of Mac, apply mounted DMG into your applications. You will find IDE4GR in applications with finder.

 

Procedure

1. Start IDE for GR

In case of Windows, execute "ide4gr.exe" in the decompressed folder.
In case of Mac, execute IDE4GR from applications in finder.
And then you will see the following IDE GUI screen.

IDE4GR


2. Select a board

Select GR-SAKURA from menu [Tools] -> [Board] as below. You can start your scketch for now.

IDE4GR


3. When using for the first time

Load the sample "Fading" from menu [File] -> [Examples] -> [03.Analog] as below.

IDE4GR


And then modify your sketch in the part "ledPin" to "PIN_LED0". About other pins definition, refer to the sketch reference.

IDE4GR



4. Connect GR-SAKURA and prepare to flash

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


5. Build and upload your sketch

Click the RIGHT arrow button, then the IDE will compile your sketch and upload it in the GR-SAKURA.
Now the LED on GR-SAKURA is fading, isn't it?

IDE4GR

 

When using serial monitor

You can communicate with GR-SAKURA by serial monitor. Please try the following.
Copy and upload the following sample in your sketch.

void setup() {
  Serial.begin(9600);
}
 
void loop() {
  static int oldtime = 0;
  if((millis() - oldtime) > 1000){
    Serial.println("Hello World");
    oldtime = millis();
  }
  
  if(Serial.available()){
    if(Serial.read() == 'a'){
      Serial.println("Hi, I'm SAKURA!");
    }
  }
}
                                
Select the port

After uploading the sketch above, select the port from menu [Tools] -> [Serial Port] as below. Note that your PC recognize the port after executing "Serial.begin". So you cannot find the port when GR-SAKURA didn't start.

IDE4GR


Display Serial monitor

Click the button as below.

IDE4GR


then you will see the Serial monitor and displayed "Hello World". And then click send after input 'a' as below.

IDE4GR

GR-SAKURA reply to you.

IDE4GR

share