error: expected primary-expression before ')' token ACCELEROMETER

Hi, I have to do a project for my school. It consists of doing a glove which is able to translates to moves from the official sign language to text (on an Android device via AppInventor). It’s based on accelerometers. When I send the program on the Uno, O have the following error : error: expected primary-expression before ‘)’ many times. Here is the part of my code which is problematic :

if
(

ax2>-20000 && ax2<-12000 && ay2>-18000 && ay2<-10000 &&
ax3>-18000 && ax3<-7000 && ay3>100 && ay3<6000 &&
ax4>600 && ax4<6500 && ay4>-13000 && ay4<-20000 &&
ax5>8500 && ax5<1100 && ay5>-6000 && ay5<-17000) ;

Serial.print (“A”);

This is for the letter A, and for example, ax2 corresponds to the value of the X-axis of the second accelerometer (I wasn’t able to do the thumb unfortunately), but anyway, the error message is for the last line. I would like to know if this part of code is OK for Arduino, knowing that I’ve already declared the accelerometers, and the axis.
Thank you very much for your help, I need a quick answer (it’s for tomorrow !!)
(If you wants, I’ve put the program below)

READER_MPU_CALIBRE.ino (14.8 KB)

  if
  (
    ax2 > -20000 && ax2 < -12000 && ay2 > -18000 && ay2 < -10000 &&
    ax3 > -18000 && ax3 < -7000 && ay3 > 100 && ay3 < 6000 &&
    ax4 > 600 && ax4 < 6500 && ay4 > -13000 && ay4 < -20000 &&
    ax5 > 8500 && ax5 < 1100 && ay5 > -6000 && ay5 < -17000) ;
  Serial.print ("A");
  )

Look carefully at the curly brackets associated with this if command.

Yes that is problematic.Putting a semicolon at the end of an "if" is almost always never a good idea.
(Can't see your code because I'm posting from my phone)

So what do I have to do exactly? (sorry i'm a novice in arduino :sweat_smile: ) Do I only have to remove the semicolon?
Thank you

What happened when you tried removing it?
Things got better right?

Unfortunately, it doesn't change anything. I still have the same errors :frowning:

Then you haven't fixed the other problems with braces.(sorry, still can't see your code)

You've got five minutes between posts; take your time

Still the same, even with braces…

if
{

ax2>-20000 && ax2<-12000 && ay2>-18000 && ay2<-10000 &&
ax3>-18000 && ax3<-7000 && ay3>100 && ay3<6000 &&
ax4>600 && ax4<6500 && ay4>-13000 && ay4<-20000 &&
ax5>8500 && ax5<1100 && ay5>-6000 && ay5<-17000)

Serial.print (“A”);
}

But braces don’t go there

if (condition)
{
  // Some code
}
else // optional
{
  // Some other code.
}

Please remember to use code tags when posting code.

 if 
 {

 ax2>-20000 && ax2<-12000 && ay2>-18000 && ay2<-10000 &&
 ax3>-18000 && ax3<-7000 && ay3>100 && ay3<6000 &&
 ax4>600 && ax4<6500 && ay4>-13000 && ay4<-20000 &&
 ax5>8500 && ax5<1100 && ay5>-6000 && ay5<-17000) }
 

 
  Serial.print ("A");

Still the same…

if 
 {

Still the same…

I’m not disagreeing there.

See reply#8

You mean that I have to use the "else" instead of the "&" ?
If it's wrong, couldn't you simply write me the right code ? quickly?

See reply #8, or just about any of the examples in the IDE

I've read the Reply #8, that's what i've done, i've done the same structure, isn't it ?

Look carefully at reply #9, then look equally carefully at reply #8.
Or just about any of the IDE examples.