プログラムで使われている関数部分などをSAKURAのものにかえて使いたいと考えているのですがいまいちどうやればいいか理解できず教えていただけるとありがたいです
(http://www.instructables.com/id/TimeDuino-Arduino-based-clock-using-7-segment-dis/)
このプログラムをGRSAKURAで動かしたいと考えています
"/* Arduino Based - 7Seg Display Clock (4 Digits HH : MM)
Can be activated via sound through the microphone
Dev: Michalis Vasilakis // Date: 30/12/2015 // License: BY-NC-SA
More info soon at www.ardumotive.com
//Library
include "SevenSeg.h"
include <DS1302.h>
//Seven Seg and DS1302 init
SevenSeg disp (11,12,8,7,6,10,9); //Defines the segments A-G: SevenSeg(A, B, C, D, E, F, G);
const int numOfDigits =4; //Number of 7 segments
int digitPins [numOfDigits]={3,4,5,13}; //CC(or CA) pins of segment
DS1302 rtc(0,1,2); // Init the DS1302
Time t; // Init a Time-data structure
//Constants
const int selectBT = A0; //Select - Set button at pin A0
const int changeBT = A1; //Change button at pin A1
const int showBT = A2; //Show time button at pin A2
const int mic = A3; //Microphone at pin A3
const int leds= A4; //Leds to seperate time from min HH : MM
//Variables
int hour;
int min;
String clock;
int number;
int count=0;
unsigned long cc=0;
int sound;
int flag=0;
int flag1=0;
void setup() {
//Define Pins as inputs or outputs:
pinMode(selectBT, INPUT_PULLUP);
pinMode(changeBT, INPUT_PULLUP);
pinMode(showBT, INPUT_PULLUP);
pinMode(min, INPUT);
pinMode(leds, OUTPUT);
// Set the clock to run-mode, and disable the write protection
rtc.halt(false);
rtc.writeProtect(false);
//Defines the number of digits to be "numOfDigits" and the digit pins to be the elements of the array "digitPins"
disp.setDigitPins ( numOfDigits , digitPins );
//Only for common cathode 7segments
disp.setCommonCathode();
//Control brightness (values 0-100);
disp.setDutyCycle(70);
disp.setTimer (2);
disp.startTimer ();
}
void loop()
{
sound = analogRead(mic);
if ((hour<=9) && (min>9)){
clock = '0' + String(hour) + String(min);
}
else if ((min<=9) && (hour>9)){
clock = String(hour) + '0' + String(min);
}
else if ((hour<=9) && (min<=9)){
clock = '0' + String(hour) + '0' + String(min);
}
else{
clock = String(hour) + String(min);
}
number = clock.toInt();
if (digitalRead(selectBT) == LOW){
delay(300);
count++;
if (count>2){
count=0;
rtc.setTime(hour, min, 0); // Set the hour to 12:00:00 (24hr format)
}
}
if (count>0){
if (digitalRead(changeBT) == LOW){
delay(300);
if (count == 1){
if (hour>22){
hour=0;
}
else{
hour++;
}
}
if (count == 2){
if (min>58){
min=0;
}
else{
min++;
}
}
}
}
else{
// Get data from the DS1302
t = rtc.getTime();
hour = t.hour;
min = t.min;
}
if ((digitalRead(showBT) == LOW) || (sound<445 || sound>485)){
delay(500);
//...ones, turn led on!
if ( flag == 0){
digitalWrite(leds, HIGH);
flag=1; //change flag variable
}
//...twice, turn led off!
else if ( flag == 1){
flag=0; //change flag variable again
digitalWrite(leds, LOW);
hideTime();
}
}
if (flag == 1){
showTime();
}
else{
}
}
void showTime(){
disp.write(clock);
}
void hideTime(){
disp.write(" ");
}
ISR( TIMER2_COMPA_vect ){
disp.interruptAction ();
}"