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

Ringo setup, hardware, basic programming. User to user support.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Quinten1333
Posts: 7
Joined: Thu Sep 10, 2015 8:58 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

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: 180
Joined: Tue Jul 28, 2015 12:56 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

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
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

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: 180
Joined: Tue Jul 28, 2015 12:56 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

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

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


Quinten1333
Posts: 7
Joined: Thu Sep 10, 2015 8:58 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

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


[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Who is online

Users browsing this forum: No registered users and 29 guests