PHASE_2:2:1: error: a function-definition is not allowed here before '{' token
{
^
TS:17:1: error: expected '}' at end of input
}
^
exit status 1
'Phas' was not declared in this scope
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
I keep getting this but i don't know how to solve it i am using another tab to work on a project but i am just testing if it will work so can anyone help me with getting rid of this problem.
There’s a few errors there! The error messages are giving the clues as to where your mistakes are
There’s could be a number of sources of mistakes in your code. Really you need to post your code correctly so people can compare the code to the errors to be sure.
After that, basically all function definitions should start at the beginning of a line. Your loop() does not start at the beginning of a line after a autoformat indicating that you're missing a } somewhere in your code before that.
This is what it looks like at the moment:
void setup()
{
}
void Phase()
{
if (target() > 15)
{
follow();
}
else
{
digitalWrite(13, LOW);
digitalWrite(12, LOW);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
delay(3000);
digitalWrite(13, HIGH);
digitalWrite(12, LOW);
digitalWrite(9, HIGH);
digitalWrite(8, LOW);
}
void loop()
{
// put your main code here, to run repeatedly:
}
In future, please post full code; you might have plenty of other errors.
Please read the post at the start of any forum , entitled "How to use this Forum".
OR http://forum.arduino.cc/index.php/topic,148850.0.html.
Then look down to item #7 about how to post your complete code.
It will be formatted in a scrolling window that makes it easier to read.
Count your { and your }.
You may not have enough }.