Totally Stumped, Newbie here with a token error :(

Hey all,
iv been working on an airsoft bomb prop for the past few weeks. Iv found some code which somebody else has built but it doesn't work. Iv gone through it and replaced all the areas i think caused an issue to myself ( LCD codes etc ). But i cannot clear the last few error codes, this is what I'm getting;

sketch_jul01b.ino: In function 'void loop()':
sketch_jul01b:445: error: a function-definition is not allowed here before '{' token
sketch_jul01b:748: error: expected }' at end of input sketch_jul01b:748: error: expected }' at end of input

and it is relevant to this area of code;

boolean getArmCode()

{

  // returns true when all PW keys are pressed in sequence

  // returns false when number of keys in pW pressed but don't exactly match the PW

  // CANCEL_KEY erases all previous digits input

  int count=0;  // how many keys we have

  int matchCount=0;  // how many keys match

 

  if(repeat == 0){

750 lines of code so I'm sure its full of things going wrong, and i know absolutely nothing about coding. Just trying to pick up a bit of knowledge to help me with this project!

Anything anyone here can help me with?

Thanks,

Chandler.

In function 'void loop()':
sketch_jul01b:445: error: a function-definition is not allowed here before '{' token

Huge clue.

Post your code

sketch_jul01b.ino: In function 'void loop()':
sketch_jul01b:445: error: a function-definition is not allowed here before '{' token

So, why are you trying to define one there?

and it is relevant to this area of code;

What you think and what is true are two different things. Post ALL of your code. Use the Additional Options link below the text entry area if it is too big to copy/paste (between code tags; use the # icon).

Hey thanks for the swift replies!

i didn't want to post it all up as the rules said not to post 100's of lines of code! And to top it off I'm going to be hugely embarrassed when you see the code i have totally butchered in a poor effort to get running !

airsoftcode.rtf (13.2 KB)

If you put each { on a new line, and line it up with the corresponding }, you'll see that the switch statement is not complete. It's missing a close }. You'll also see that loop is not complete. It's missing a }.

For future reference, rtf is a poor format for sharing what are basically text files. Leave the ino extension.

PaulS:
If you put each { on a new line, and line it up with the corresponding }, you'll see that the switch statement is not complete. It's missing a close }. You'll also see that loop is not complete. It's missing a }.

For future reference, rtf is a poor format for sharing what are basically text files. Leave the ino extension.

Hey,
Thanks! sorry about the sharing format i had no idea we could attach the INO files on here!
I'll go through it again tonight and hopefully i'll at least get it to compile! Thanks for your help.

Chandler

If you "...know absolutely nothing about coding...", then starting with 750 lines of code is the wrong way to go about learning.

A suggestion: Start small. Really small.

vaj4088:
If you "...know absolutely nothing about coding...", then starting with 750 lines of code is the wrong way to go about learning.

A suggestion: Start small. Really small.

Never a Truer word said!

But as i copied the code i hoped it would work, a few tweaks here and there to the lcd.print's to customise it, thought i'd be okay! As i couldn't get the original code to work it left me a bit out in the deep!

Cheers