error: expected unqualified-id before numeric constant. No idea what this means

error: expected unqualified-id before numeric constant. No idea what this means

我在使用 arduino 时遇到了这个错误代码。该代码用于接收文本并以莫尔斯码输出 LED。目前没有文字输入功能。谢谢!

    void setup() {
      // put your setup code here, to run once:

    }

    void a(){
     digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);        
     digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
      delay(3000);   
    }
    void b(){
      digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
     digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000); 
      digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000); 
      digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(3000); 
    }

    void c(){
    digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
      digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);  
      digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
     digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(3000);  
    }
    void d(){
    digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
     digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000); 
      digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(3000); 
    }
    void e(){
       digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(3000);  
    }
    void f (){
    digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);    
      digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);    
      digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
     digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(3000);   
    }
    void g (){
    digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
     digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
     digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(3000); 
    }
    void h (){
    digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);     
      digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);     
      digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);     
      digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(3000);     

    }
    void i (){
    digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);     
      digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(3000);     
    }
    void j (){
    digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);     
      digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
     digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
     digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(3000);

    }
    void k (){
    digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
      digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);  
     digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(3000);

    }
    void l (){
     digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);  
      digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
       digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);  
       digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(3000);  
    }
    void m (){
    digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
     digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(3000);
    }
    void n (){
    digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
     digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(3000);  
    }
    void o (){
    digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
     digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
     digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(3000);
    }
    void p (){
     digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);        
      digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
     digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
     digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(3000);  
    }
    void q (){
    digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
     digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
     digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000); 
        digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(3000);
    }
    void r (){
     digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);  
      digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
       digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(3000);  
    }
    void s (){
     digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);  
       digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);  
       digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(3000);  
    }
    void t (){
    digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
    }
    void u (){
    digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000); 
      digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000); 
      digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(3000);
    }
    void v (){
    digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000); 
      digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000); 
      digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000); 
      digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(3000);
    }
    void w (){
     digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);  
      digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
     digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(3000);
    }
    void x (){
    digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
     digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);   
      digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000); 
    digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(3000);  
    }
    void y (){
    digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
     digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);   
      digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
     digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(3000);
    }
    void z (){
    digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
     digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
      digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);   
       digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(3000);   

    }
    void 1 (){
     digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000); 
    digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
    digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
    digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
    digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(3000); 
    }
    void 2 (){
     digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);   
       digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000); 
    digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
    digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
    digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(3000);

    }
    void 3 (){
     digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);   
       digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);   
       digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);   
      digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
     digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(3000);
    }
    void 4 (){
     digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);   
       digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);   
       digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);   
       digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);   
      digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(3000);
    }

void 5 是数字 5 所以当有人输入 9 时,它会莫尔斯闪烁 5

void 5 (){
     digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);   
       digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);   
       digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);   
       digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);   
       digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(3000);   
    }
    void 6 (){
    digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);  digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);  digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);  digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(3000);  
    }
    void 7 (){
    digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
     digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);  digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);  digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(3000);  
    }
    void 8 (){
    digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
     digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(1000);  
      digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(3000);  

void 9 是数字 9 所以当有人输入 9 时,它会闪烁 9

    }
    void 9 (){
    digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
     digitalWrite(13, HIGH);
      delay(1000);    
      digitalWrite(13, LOW);
      delay(3000);  
    }
    void 0 (){
    digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);digitalWrite(13, HIGH);
      delay(3000);  
      digitalWrite(13, LOW);
     delay(1000);
    }


    void loop() {
      // put your main code here, to run repeatedly:
     //put enter text code here:

    }

谢谢!

以下是所有错误:

MorseBusyWork.ino:29:6: error: expected unqualified-id before numeric constant
MorseBusyWork.ino:30:6: error: expected unqualified-id before numeric constant
MorseBusyWork.ino:31:6: error: expected unqualified-id before numeric constant
MorseBusyWork.ino:32:6: error: expected unqualified-id before numeric constant
MorseBusyWork.ino:33:6: error: expected unqualified-id before numeric constant
MorseBusyWork.ino:34:6: error: expected unqualified-id before numeric constant
MorseBusyWork.ino:35:6: error: expected unqualified-id before numeric constant
MorseBusyWork.ino:36:6: error: expected unqualified-id before numeric constant
MorseBusyWork.ino:37:6: error: expected unqualified-id before numeric constant
MorseBusyWork.ino:38:6: error: expected unqualified-id before numeric constant
MorseBusyWork.ino:391:6: error: expected unqualified-id before numeric constant
MorseBusyWork.ino:413:6: error: expected unqualified-id before numeric constant
MorseBusyWork.ino:436:6: error: expected unqualified-id before numeric constant
MorseBusyWork.ino:458:6: error: expected unqualified-id before numeric constant
MorseBusyWork.ino:480:6: error: expected unqualified-id before numeric constant
MorseBusyWork.ino:502:6: error: expected unqualified-id before numeric constant
MorseBusyWork.ino:520:6: error: expected unqualified-id before numeric constant
MorseBusyWork.ino:539:6: error: expected unqualified-id before numeric constant
MorseBusyWork.ino:559:6: error: expected unqualified-id before numeric constant
MorseBusyWork.ino:578:6: error: expected unqualified-id before numeric constant
Error compiling.

MorseBusyWork 是文件名...

您不能将函数命名为数字常量,将您的函数名称更改为 one(); two(); three(); 或更好地创建一个函数,该函数采用 int 作为次数眨眼并使用循环而不是按指数方式复制粘贴您自己的代码。

您应该在您的函数中至少使用 1 个字母:

void number1(){
    // ...
}