Function not being called from multiple if construction

I hope not being scolded but can’t find reference to my problem…
I want to let a motor turn right left or stop it depending on heading.
It seems the functions RotateMotorRight, RotateMotorLeft and MotorStop) are not being called, but why ?
Any constructive comments are welcomed !

here the partial code:

float angle = heading * 180/M_PI;
Winkel= (int)angle;

//=============================================================================================================

if (Winkel << HeadingToMobil) // WHY void MotorRotateRight or Left or Stop are not called ???
MotorRotateRight; //
// WWWWWW
if (Winkel >> HeadingToMobil) // WW WWW
MotorRotateLeft; // WWW
// WWW
if (Winkel == HeadingToMobil) // WWW
MotorStop; // WWW WW
// WWWWWW
//
// WWW
// WWW
//==============================================================================================================

Serial.print(" Heading: ");
Serial.println(angle);

}
else
{
Serial.println("=Compass Failed=");
}
delay(500); // Run again in .5 s (500 ms)

}

int ReadByte(uint8_t addr, uint8_t reg, uint8_t *data) // Read a byte on the i2c interface

{

Wire.beginTransmission(addr); // Do an i2c write to set the register that we want to read from
Wire.write(reg);
Wire.endTransmission();

Wire.requestFrom(addr, (uint8_t)1); // Read a byte from the device
if (Wire.available())
{
*data = Wire.read();
}
else
{
return -1; // Read nothing back
}

return 0;
}

void WriteByte(uint8_t addr, uint8_t reg, byte data) // Write a byte on the i2c interface
{
Wire.beginTransmission(addr); // Begin the write sequence
Wire.write(reg); // First byte is to set the register pointer
Wire.write(data); // Write the data byte
Wire.endTransmission(); // End the write sequence; bytes are actually transmitted now
}

void MotorRotateLeft()
{
digitalWrite(MotorPinRight,LOW);
delay(10);
digitalWrite(MotorPinLeft,HIGH);
}

void MotorRotateRight()
{
digitalWrite(MotorPinLeft,LOW);
delay(10);
digitalWrite(MotorPinRight,HIGH);
}

void MotorStop()
{
digitalWrite(MotorPinRight,LOW);
digitalWrite(MotorPinLeft,LOW);
}

if (Winkel << HeadingToMobil)

What is this supposed to mean?

MotorRotateRight;

Is this a function call? Where are the ()?

I think you have come from another language and have not got the gist of C yet. Also post all your code and place it in

code tags

Rob

In your code:

 if (Winkel << HeadingToMobil)                // WHY void MotorRotateRight or Left or Stop are not called ???
       MotorRotateRight;                     //
                                             //             WWWWWW
 if (Winkel >> HeadingToMobil)               //           WW     WWW    
       MotorRotateLeft;                      //                 WWW
                                             //               WWW
 if (Winkel == HeadingToMobil)               //             WWW   
        MotorStop;                           //            WWW     WW

we have no idea what HeadingToMobil is or how it’s set, which is why you should post all of your code. Also, the “<<” and “>>” operators are for bit shifting; probably not what you want to do here. Secondly, when you write the name of a function like you did here:

 if (Winkel << HeadingToMobil)               // WHY void MotorRotateRight or Left or Stop are not called ???
       MotorRotateRight;                     //

MotorRotateRight resolves to the memory address where the MotorRotateRight function is located. I think what you are trying to do is call, or invoke, the function at that point. To do that, you must supply parentheses after the function name. Therefore,

 if (Winkel << HeadingToMobil)             
       MotorRotateRight();                     // Now you are calling the function...

actually calls the function. It might help clarify things if you: 1) Read the first three posts at the top of this Forum, and 2) spend a little time with a beginning C programming book. The first suggestion will help you get a better response from those who are active on this Forum, and the second will help you frame your questions more clearly and may even help you answer some of your own questions.