Ignoring the last post i was in the meantime looking at the #define statement be-course it would work in a other part of the same code. So altered the definitions part accordantly:

```
/******************** Units for system with 6V motors *************************************/
#define SUPPLY_VOLTAGE 1350 // System supply between 6-24V DC in mV *
#define MOTOR_VOLTAGE 600 // Motor operating voltage in mV *
#define MOTOR_MIN_VOLTAGE 250 // Minimum used motor voltage in mV *
/******************** Units for system with 24V motors ************************************/
//#define SUPPLY_VOLTAGE 2450 // System supply between 6-24V DC in mV *
//#define MOTOR_VOLTAGE 2400 // Motor normal operating voltage in mV *
//#define MOTOR_MIN_VOLTAGE 1000 // Minimum desirable motor voltage in mV *
/******************** Calculate different voltages used ********************************
* We now can calculate the voltages used to control speed using PWM *
* The formula = (PWM_resolution/supply_voltage)*desired_voltage = PWM_value */
const long RotationSpeed4 = ((25500/SUPPLY_VOLTAGE)*MOTOR_VOLTAGE)/100;
const long RotationSpeed3 = ((25500/SUPPLY_VOLTAGE)*(MOTOR_VOLTAGE/4)*3)/100;
const long RotationSpeed2 = ((25500/SUPPLY_VOLTAGE)*(MOTOR_VOLTAGE/2))/100;
const long RotationSpeed1 = ((25500/SUPPLY_VOLTAGE)*MOTOR_MIN_VOLTAGE)/100;
/****************************************************************************************
* These values define the speed trajectory to reach a certain position. *
* The higher the difference the higher the speed to move the antenna. *
* Range from 180-20-8-2-0 degrees */
const int SPEED1 = 200;
const int SPEED2 = 80;
const int SPEED3 = 20;
/****************************************************************************************/
int newXAxis;
int newYAxis;
int rotorXAxis;
int rotorYAxis;
```

changing from #define to a constant with type. The code looks now:

```
int rotorSpeed(int toMove) {
int Speed;
if(toMove >= SPEED1) {
Speed = RotationSpeed4;
}
if(toMove >= SPEED2 && toMove < SPEED1) {
Speed = RotationSpeed3;
}
if(toMove >= SPEED3 && toMove < SPEED2) {
Speed = RotationSpeed2;
}
else {
Speed = RotationSpeed1;
}
return Speed;
}
```