Expected '(' before '{' token

#include <ipst.h>
void setup() {
OK();
while(in(12)==1){}
if(in(12)==0)
{
fd(30);
delay(11000);
ao();
beep(17);
}
else if
{
while(in(13)==1){}
if(in(13)==0)
{
fd(30);
delay(10000);
ao();
beep(17);
}
}
}
void loop() {

}

Please fix this problem for me or fix the program correctly. Thank you.

if what?

Or do I just have to use else ?

What ware the names of the magic numbers used?

#include <ipst.h>
void setup() {
  OK();
  while (in(12) == 1) {}
  if (in(12) == 0)
  {
    fd(30);
    delay(11000);
    ao();
    beep(17);
  }
  else if
{
  while (in(13) == 1) {}
    if (in(13) == 0)
    {
      fd(30);
      delay(10000);
      ao();
      beep(17);
    }
  }
}
void loop() {

}

2 problems fixed. Issue 1, no code tags. Issue number 2 not properly formatted.

Other problems become quite obvious with the fixing of those 2 problems.

Hi,
don´t forget Read:
How to get the best out of this forum - Using Arduino / Installation & Troubleshooting - Arduino Forum

and redo your post correcting how you posted the code.
Use tags </>

When I press the button connected to port 13, the motor doesn't turn, how do I fix it?

#include <ipst.h>
void setup() {
OK();
while (in(12) == 1) {}
if (in(12) == 0)
{
fd(30);
delay(11000);
ao();
beep(17);
}
else
{
while (in(13) == 1) {}
if (in(13) == 0)
{
fd(30);
delay(10000);
ao();
beep(17);
}
}
}
void loop() {

}

the first what you must to fix - insert code with code tags

How to do it?

Hello winnnnn

Why do you open a second thread?

I asked the wrong question

Did you read the forum guidelines ?

1 Like

I'm very sorry I haven't read it yet.

This will never get executed, revise your program logic

1 Like

As far I see - you asked almost the same question.
You shouldn't open more than one topic regarding to the same problem, it is a violation of the forum rules.
What did not suit you in the first topic? Didn't they fix your code?
You shouldn't wait for this. Nobody will do your tasks for you.

I will improve

@winnnnn, do not cross-post. Threads merged.

Where oh where is Caesar's underwear?

@Idahowalker fixed the syntax error that would have made it not compile, let alone execute.

iscp.h seems to be some kind of further Arduino-style distancing from real code ms reality, I assume in() is some kind of input function, so

  while (in(12) == 1) {}
  if (in(12) == 0)
  {

looks like it waits for in(12) to go LOW, then double checks to make sure it did (!), and does execute the if block of code.

I think.

a7

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.