Obviously syntax error ?

I can not get the for -next statement to work nor can I get the goto test (sub-routine) to work. Can a good natured soul please advise me what my error is?

int pin0 =0;
int pin1 =1;
int pin2 = 2;
int pin8 =8;
int pin9 = 9;
int pin10 = 10;

int val0 ;
int val1 ;
int val2 ;
//========================
void setup()
{
pinMode(pin0, INPUT);
pinMode (pin1, INPUT);
pinMode ( pin2, INPUT);
pinMode (pin8, OUTPUT);
pinMode (pin9 , OUTPUT);
pinMode (pin10, OUTPUT);
}
//---------------------------------------------------------
void loop()
{
val0 = digitalRead(pin0);
val1 = digitalRead(pin1);
val2 = digitalRead(pin2);

// …
if (val0 == HIGH){
test)(); // if this input is high goto ‘void test’
}
// …
while (val0 == LOW) // I tried this as a ‘do while’ no luck

for (int i=0; i <= 10; i++) //
delay (1000);
(digitalWrite(pin8, LOW));
delay (1000);

// …

void test() {

if (val1 == LOW)(digitalWrite(pin9, HIGH));
if (val2 == LOW)(digitalWrite(pin10, HIGH));
}

You are missing the closing brace for the loop function

It would be easier to help if you said what you wanted the for loop to do, but you need to use curly braces around the lines within the for loop or only the first line will be repeated.

for (int i=0; i <= 10; i++)
{
delay (1000);
digitalWrite(pin8, LOW);
delay (1000);
}
The above code turns pin 8 low after 1 second and then delays 19 seconds. The led is not turned on

Also, you need to change

test)();

to

test();

What I was trying to do was:

if pin0 was HIGH ’ : goto the “test ()”(subroutine).

test() : was to be able to manually switch O/P nine and ten.

if pin0 is LOW:.

the “FOR” routine was to swicth O/P eight ‘ON and OFF’ ten times and then wait on further instruction.

I am cannibalising programs that have been written by others as a learning exercise.

I have placed brackets as suggested and removed TBAr and mem and still getting scope or bracket errors. ANY further suggestions?

int pin0 =0;  // pins 0 and 1 are used by serial so should be avoided !!!
int pin1 =1;  
int pin2 = 2;       
int pin8 =8;       
int pin9 = 9;    
int pin10 = 10;         

int val0 ;
int val1 ;
int val2 ;
//========================
void setup()
{
  pinMode(pin0, INPUT);
  pinMode (pin1, INPUT);
  pinMode (pin2, INPUT);
  pinMode (pin8, OUTPUT);
  pinMode (pin9 , OUTPUT);
  pinMode (pin10, OUTPUT);
}
//---------------------------------------------------------
void loop()
{    
  val0 =   digitalRead(pin0);
  val1 =   digitalRead(pin1);
  val2 =   digitalRead(pin2);

  if  (val0 == HIGH){
    test();   // if this input is high call test()
  }                             

  for (int i=0; i <= 10; i++)  {  
    delay (1000); 
    digitalWrite(pin8, LOW); 
    delay (1000); 
    digitalWrite(pin8, HIGH);   
  }
}

void  test() {  

  if (val1 == LOW)
     (digitalWrite(pin9, HIGH));
  if (val2 == LOW)(
     digitalWrite(pin10, HIGH));
}

mem

thank you for your assistance.

the program now does what it is meant to do.

Could I suggest to all new Arduino players to be aware of the bracket type particularly if your eye sight is not 20/20. A magnifying glass is a most helpful companion.