error a function-definition is not allowed here bevore "{" token

Ringo setup, hardware, basic programming. User to user support.
Quinten1333
Posts: 7
Joined: Thu Sep 10, 2015 8:58 pm

error a function-definition is not allowed here bevore "{" token

Postby Quinten1333 » Fri Sep 25, 2015 8:33 pm

after playing for a while this error poped up

Arduino: 1.6.4 (Windows 8.1), Board:"Arduino Fio"

FunStuff.ino: In function 'void sensorcheck()':
FunStuff:29: error: a function-definition is not allowed here before '{' token
FunStuff:45: error: a function-definition is not allowed here before '{' token
FunStuff:55: error: a function-definition is not allowed here before '{' token
RingoHardware:948: error: expected '}' at end of input
a function-definition is not allowed here before '{' token

i've tried to delte the file funstuff but then it will just say
Arduino: 1.6.4 (Windows 8.1), Board:"Arduino Fio"

In file included from Navigation.ino:26:0:
A LOT OF LOCATION'S IN MY ARDUINO INSTALLATION FOLDER

Navigation:41: error: a function-definition is not allowed here before '{' token
Navigation:45: error: a function-definition is not allowed here before '{' token
RingoHardware:948: error: expected '}' at end of input
a function-definition is not allowed here before '{' token

so that doesn't work

I made about 5 sketches now and they all look (quite) the same(line follower).
also what i just edited in my sketch was the line detecting part wich is in all my sketches

hope someone knows the problem
sorry for bad english

Kevin
Posts: 177
Joined: Tue Jul 28, 2015 12:56 am

Re: error a function-definition is not allowed here bevore "{" token

Postby Kevin » Fri Sep 25, 2015 8:39 pm

Quinten,

You want to leave all the files in place. It sounds as if there's a syntax error someplace. I don't think Arduino forces you to "define" a function before using it (this is a rule in C but I think Arduino overlooks this).

Check that you didn't miss a semicolon in your new function, and also make sure you didn't forget a closing curly brace }

If all else fails, open a clean copy of the Base Sketch, make your changes, then post it here so we can see it.

Good luck.

Quinten1333
Posts: 7
Joined: Thu Sep 10, 2015 8:58 pm

Re: error a function-definition is not allowed here bevore "{" token

Postby Quinten1333 » Fri Sep 25, 2015 8:46 pm

I am so stupid

your right i forgot to use closing brackets in my new function

but how does that affect other tabs?


THANKS FOR RESPONDING SO FAST

Kevin
Posts: 177
Joined: Tue Jul 28, 2015 12:56 am

Re: error a function-definition is not allowed here bevore "{" token

Postby Kevin » Fri Sep 25, 2015 11:02 pm

Quinten1333 wrote:but how does that affect other tabs?


Most compilers aren't very good at telling you exactly where the problem is. It's likely that you called a function that is actually found on one of the tabs around the place the missing } was. Because that's the last thing the compiler looked at, that's were it maybe though the error was. You can often guess what the problem may be by looking at the error though. It'll at least give you a clue of what to look at.

Quinten1333
Posts: 7
Joined: Thu Sep 10, 2015 8:58 pm

Re: error a function-definition is not allowed here bevore "{" token

Postby Quinten1333 » Sat Sep 26, 2015 5:08 pm

okey thanks for your help


Who is online

Users browsing this forum: No registered users and 1 guest