Functions Problem

Arduino: 1.8.12 (Windows Store 1.8.33.0) (Windows 10), Board: "Arduino Uno"

C:\Users\Dorian\Documents\Arduino\TEST\TEST.ino: In function 'void loop()':

TEST:28:3: error: 'Phas' was not declared in this scope

Phas()

^~~~

C:\Users\Dorian\Documents\Arduino\TEST\TEST.ino:28:3: note: suggested alternative: 'Phase'

Phas()

^~~~

Phase

C:\Users\Dorian\Documents\Arduino\TEST\PHASE_1.ino: In function 'void Phase()':

PHASE_1:3:8: error: 'target' was not declared in this scope

while (target() > 15)

^~~~~~

PHASE_1:7:10: error: 'target' was not declared in this scope

while (target() < 15)

^~~~~~

PHASE_1:19:5: error: 'Tilt' was not declared in this scope

Tilt();

^~~~

C:\Users\Dorian\Documents\Arduino\TEST\PHASE_1.ino:19:5: note: suggested alternative: 'bit'

Tilt();

^~~~

bit

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. :frowning: :frowning:

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.

function with error.
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);

}

error

void loop() {
// put your main code here, to run repeatedly:
Phase();

Phase2();
}

Could you take a few moments to Learn How To Use The Forum.
It will help you get the best out of the forum in the future.
Other general help and troubleshooting advice can be found here.

Use tools -> autoformat in the IDE.

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.

Hi,
Welcome to the forum.

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 }.

Tom... :slight_smile: