Not able to understand the error

Heloo, I was able to get the code for an R303a fingerprint module with arduino but, when I verify the code, I get the following errors which appear meaningless , this is my code:

#include <SoftwareSerial.h>
#define MAX 12
SoftwareSerial FP(2,3);
 
byte Response[20];
byte Resp1[]={0xEF,0x01,0xFF,0xFF,0xFF,0xFF,0x07,0x00,0x05}; //type=1
byte Resp2[]={0xEF,0x01,0xFF,0xFF,0xFF,0xFF,0x07,0x00,0x03}; //type=2
byte Resp3[]={0xEF,0x01,0xFF,0xFF,0xFF,0xFF,0x07,0x00,0x07}; //type=3
 
////////////// Set for generating TemplateNumbers in the library
byte TemplateNumCommand[]={0xEF,0x01,0xFF,0xFF,0xFF,0xFF,0x01,0x00,0x03,0x1d,0x00,0x21};
int TemplateNumCommandSize=12;
int TemplateNumCommandResponseCheckLength=9;
int TemplateNumCommandResponseLength=14;
int TemplateNumberResponseConfirmation=10; //confirmation byte: this must be 0
int TemplateNumbers[2];//byte 11 and 12
int TemplateNumberRespType=1;
////////////////////////////////Generate Image 1. GenImg//////////////////////////////////////////////////////////////
byte GenImgCommand[]={0xEF,0x01,0xFF,0xFF,0xFF,0xFF,0x01,0x00,0x03,0x01,0x00,0x05};
int GenImgCommandSize=12;
int GenImgCommandResponseCheckLength=9;
int GenImgCommandResponseLength=12;
int GenImgResponseConfirmation=9; //confirmation byte: this must be 0
//Confirmation code=01H: error when receiving package;
//Confirmation code=02H: can’t detect finger;
//Confirmation code=03H: fail to collect finger;
/////////// For converting the acquired image to character file 2. Img2Tz/////////////
byte BufferId=0x01;//0x02 for Buffer2
byte CheckSum=0x08; //for Buffer2 its 0x09;
 
byte Img2TzCommand[]={0xEF,0x01,0xFF,0xFF,0xFF,0xFF,0x01,0x00,0x04,0x02,BufferId,0x00,CheckSum};
int Img2TzCommandSize=13;
int Img2TzCommandResponseCheckLength=9;
int Img2TzCommandResponseLength=12;
int Img2TzRespType=2;
int Img2TzResponseConfirmation=9; //confirmation byte: this must be 0
 
////////////////////3. RegModel/////////////////////////////////////
byte RegModelCommand[]={0xEF,0x01,0xFF,0xFF,0xFF,0xFF,0x01,0x00,0x03,0x05,0x00,0x09};
int RegModelCommandSize=12;
int RegModelCommandResponseCheckLength=9;
int RegModelCommandResponseLength=12;
int RegModelRespType=2;
int RegModelResponseConfirmation=9; //confirmation byte: this must be 0
 
// Remember when you call this method both buffer1 and buffer2 will have same template
// before calling this method, buffer1 and buffer2 must be separately scanned and their template should be generated 
/////////////////////////
/////////////// 4. Store Template ( Uploading the template contents of buffer1/buffer2 to a specific memory location)//////////////
 
/////////////// 4. Store Template ( Uploading the template contents of buffer1/buffer2 to a specific memory location)//////////////
byte BasePageID=0x01;
byte PageID=0x00;
 
byte StoreCommand[]={0xEF,0x01,0xFF,0xFF,0xFF,0xFF,0x01,0x00,0x06,0x06,BufferId,PageID,0x00,0x00,Chec?kSum};
int StoreCommandSize=15;
int StoreCommandResponseCheckLength=9;
int StoreCommandResponseLength=12;
int StoreRespType=2;
int StoreResponseConfirmation=9; //confirmation byte: this must be 0
//Remember Page id is in the form LSB-MSB its 2 bytes so we are dealing with 255 images. Hence page id will vary from 0x00 to 0xFF
////////////////////////////////////////////////////Search Command/////////////////////////////////////////////////////////////////////////
byte SearchCommand[]={0xEF,0x01,0xFF,0xFF,0xFF,0xFF,0x01,0x00,0x08,0x04,BufferId,0x00,PageID,0x00,0x00?,0x00,CheckSum};
int SearchCommandSize=17;
int SearchCommandResponseCheckLength=9;
int SearchCommandResponseLength=16;
int SearchRespType=3;
int SearchConfirmation=9; //confirmation byte: this must be 0
int SearchResponseConfirmation=9; 
 
void SetSearchParameters()
{
SearchCommand[10]=BufferId;
SearchCommand[12]=PageID;
 
int sum=0;
for(int i=6;i<=14;i++)
{
sum+=SearchCommand[i];
}
CheckSum=sum;
SearchCommand[16]=CheckSum;
 
}
 
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
 
void StoreChecksum()
{
int sum=0;
for(int i=6;i<=12;i++)
{
sum+=StoreCommand[i];
}
CheckSum=sum;
StoreCommand[14]=CheckSum;

}
void GetID()
{
Serial.println("Enter your ID[2 4 6 8]");
int n=-1;
do
{
n=Serial.read();
n=n-48;


}while(n<0 || n>255);
PageID=BasePageID+n;
StoreCommand[11]=PageID;
Serial.print("You entered:");
Serial.println(PageID,HEX);
}
 
///////////////////Methods//////////////////////////////////////////

The errors obtained for line 54 are:
sketch_may31c:54: error: stray ‘’ in program
sketch_may31c:62: error: stray ‘’ in program
sketch_may31c:54: error: ‘Chec’ was not declared in this scope
sketch_may31c:54: error: expected `}’ before ‘u200bkSum’
sketch_may31c:54: error: expected ‘,’ or ‘;’ before ‘u200bkSum’
sketch_may31c:54: error: expected declaration before ‘}’ token

As I am not able to post the entire code here, due to size restrictions, it is present at: Loading...
I am not able to understand this, as there are no stray ‘’ in any line, and it is perfectly syntaxed. Please help.

Hi ars,

I cut and pasted your code and was getting the same errors but if you reduce the ////////////////// lines down to // then the errors are more meaningful. Both lines 54 and 62 seem to have a spurious ? character in them

sketch_may31a:54: error: 'Chec' was not declared in this scope
sketch_may31a:54: error: 'kSum' was not declared in this scope
sketch_may31a:54: error: expected `:' before '}' token
sketch_may31a:54: error: expected primary-expression before '}' token
sketch_may31a:62: error: expected primary-expression before ',' token
sketch_may31a:62: error: expected `:' before '}' token
sketch_may31a:62: error: expected primary-expression before '}' token

The code copied from the webpage seems to contain some odd characters, which are being picked up by the compiler as /'s.

If you replace the first line highlighted by the compiler with this one:

byte StoreCommand[]={0xEF,0x01,0xFF,0xFF,0xFF,0xFF,0x01,0x00,0x06,0x06,BufferId,PageID,0x00,0x00,CheckSum};

and the second one with this:

byte SearchCommand[]={0xEF,0x01,0xFF,0xFF,0xFF,0xFF,0x01,0x00,0x08,0x04,BufferId,0x00,PageID,0x00,0x00,0x00,CheckSum};

that will get rid of the ‘stray /’ errors.

for(int i=0;i<storecommandsize;i++)

needs changing to

for(int i=0;i<StoreCommandSize;i++)
for(int i=0;i<searchcommandsize;i++)

needs changing to

for(int i=0;i<SearchCommandSize;i++)

Heyy, It worked , all the previous errors are gone. But now, when I compile I get this:

fp1.cpp: In function 'int Store(int, int)': fp1:138: error: no matching function for call to 'SoftwareSerial::write(byte [15], int&)' D:\ARS\Softwares\arduino-0022\arduino-0022\libraries\SoftwareSerial/SoftwareSerial.h:95: note: candidates are: virtual void SoftwareSerial::write(uint8_t) fp1.cpp: In function 'int RegModel(int, int)': fp1:272: error: no matching function for call to 'SoftwareSerial::write(byte [12], int&)' D:\ARS\Softwares\arduino-0022\arduino-0022\libraries\SoftwareSerial/SoftwareSerial.h:95: note: candidates are: virtual void SoftwareSerial::write(uint8_t) fp1.cpp: In function 'int SearchCommandImplementation(int, int)': fp1:341: error: no matching function for call to 'SoftwareSerial::write(byte [17], int&)' D:\ARS\Softwares\arduino-0022\arduino-0022\libraries\SoftwareSerial/SoftwareSerial.h:95: note: candidates are: virtual void SoftwareSerial::write(uint8_t) fp1.cpp: In function 'int GenImg2Tz(int, int)': fp1:454: error: no matching function for call to 'SoftwareSerial::write(byte [13], int&)' D:\ARS\Softwares\arduino-0022\arduino-0022\libraries\SoftwareSerial/SoftwareSerial.h:95: note: candidates are: virtual void SoftwareSerial::write(uint8_t) fp1.cpp: In function 'int GenImg(int, int)': fp1:528: error: no matching function for call to 'SoftwareSerial::write(byte [12], int&)' D:\ARS\Softwares\arduino-0022\arduino-0022\libraries\SoftwareSerial/SoftwareSerial.h:95: note: candidates are: virtual void SoftwareSerial::write(uint8_t) fp1.cpp: In function 'int GetTemplateNumber(int, int)': fp1:592: error: no matching function for call to 'SoftwareSerial::write(byte [12], int&)' D:\ARS\Softwares\arduino-0022\arduino-0022\libraries\SoftwareSerial/SoftwareSerial.h:95: note: candidates are: virtual void SoftwareSerial::write(uint8_t)

I updated my softwareserial library to beta version(11), still it's coming like this, please help.

fp1.cpp: In function ‘int Store(int, int)’:
fp1:138: error: no matching function for call to ‘SoftwareSerial::write(byte [15], int&)’

I can’t see a function called “Store”, but it seems the compiler can.
It looks like the function called “Store” tries to use the “write” method in an unusual way.

Hey, the full code is at : http://grasshoppernetwork.com/showthread.php?tid=652 , I am not able to post here due to it's size . In that code, you will see the function store at line 120. Please help.

Interesting. After making the changes in my earlier reply and fixing the #include at the top of the sketch, it compiles fine for me.

Which version of the IDE are you using?

Arduino -0022, it gives the errors as above.

That probably explains it then. I'm running 1.0.

What happened to your indentation?

It's code found via a Google search.

D:\ARS\Softwares\arduino-0022\arduino-0022\libraries\SoftwareSerial/SoftwareSerial.h:95: note: candidates are: virtual void SoftwareSerial::write(uint8_t)

SoftwareSerial with 0022 is junk. Change all occurrences of SoftwareSerial to NewSoftSerial or upgrade to 1.0+ (recommended).