2014-12-03 3 views
0

내 arduino uno 용 프로그램을 만들었지 만 컴파일 할 수 없습니다. IRemote IRecord 예제 및 SD 예제를 기반으로 한 프로그램.Arduino에 대한 호출 기능이 없습니다.

CODE :

void sendCode(int repeat) { 
    strcodeValue = String(codeValue); 
    char filename[strcodeValue.length()+1]; 
    strcodeValue.toCharArray(filename, sizeof(filename)); 

    if (SD.exists(filename)) { 
    File myFile = SD.open(filename); 
    if (myFile) { 
    while (myFile.available(filename)) { 
     codeValue = myFile.read(); 
    } 
    myFile.close(); 
    } 
    } 
... 
} 

오류 :

IRrecord.ino: In function 'void sendCode(int)': 
IRrecord.ino:130:37: error: no matching function for call to 'File::available(char [(((sizetype)<anonymous>) + 1)])' 
IRrecord.ino:130:37: note: candidate is: 
In file included from IRrecord.ino:18:0: 
C:\Program Files (x86)\Arduino\libraries\SD\src/SD.h:38:15: note: virtual int File::available() 
    virtual int available(); 
      ^
C:\Program Files (x86)\Arduino\libraries\SD\src/SD.h:38:15: note: candidate expects 0 arguments, 1 provided 
Error compiling. 

파일 이름은 IR 센서에서 읽을 수 있습니다.

아무도 도와 줄 수 있습니까?

답변

0

그것은 반드시 읽어야

while (myFile.available(filename)) { 

과 같은

while (myFile.available()) {