预期','或者' ...'之前'阵列'在arduino 1.0.5

时间:2015-05-09 19:18:11

标签: arrays compiler-errors arduino arduino-uno arduino-ide

我正在尝试在arduino 1.0.5中制作一个机器人控制程序,我一直收到这个错误,但这没有任何意义。

代码:

String speeds[7] = {"Stop", "verySlow", "Slow", "ratherSlow", "ratherFast", "Fast", "veryFast"};
//                    0         15        30         45           60          75          90  


void setup(){
    Serial.begin(9600);
    Serial.println("HELLO WORLD");
    Serial.println("Setting up\nOne moment please");
    for(int i = 0; i < 3; i++){ 
        Serial.print(".");
        delay(2000);
    }
 }

void speedSetup(int direction, String speedName){ 
    int speedForServo;
    //int speedToUse = getStringIndex(speeds, speedName);
    if(direction == 1 ){

    }
}

//int getSrtringIndex(String[] array, String string){
//for(int i = 0; i < array.len()+1; i++){

//}
//}  

void loop(){}

忽略评论,它们主要是稍后要添加的代码。

从控制台复制的错误:                                                                                  sketch_may09b:4:错误:预期&#39;,&#39;或者&#39; ...&#39;在&#39; array&#39;

之前

0 个答案:

没有答案