L298N motor driver speed and direction

I have an L298N board much like this one: http://www.ebay.co.uk/itm/Dual-H-Bridge-Motor-Driver-L298N-for-Arduino-PIC-etc-DC-Stepper-L298-Board-/160831035879?pt=UK_Computing_Other_Computing_Networking&hash=item257246d9e7

I'm just using one side to control a 12v DC motor. Currently sending it a direction and PWM using code base on one of the standard examples. The thing that is confusing me is that when the direction is '1' 255 is stopped and 0 is max speed on the PWM, when the direction is '0' these are reversed and 0 is stopped and 255 is max speed. Is this normal. It's making my code a little more tricky than I would like.

This is the code I have. There is a variable resistor that as you turn it the motor slows, stops, reverses and speeds up. It works fine. Just seems a little odd about the speed thing. If there is a better way to achieve this then I would be happy to hear it.

//Arduino PWM Speed Control:
const int E1 = 5;  
const int M1 = 4; 
const int E2 = 6;                      
const int M2 = 7;   

const int RsupplyPIN = 14; 
const int RvaluePIN = 15;                      
const int RgroundPIN = 16;                    
const int RvalueMAX = 825;                    
const int RvalueMIN = 775;                    
const int RvalueZERO = 800;   

int Rvalue = 0; 
int Direction = 0;  
int PWMvalue =0 ;
 
void setup() 
{ 
    pinMode(M1, OUTPUT);   
    pinMode(M2, OUTPUT); 
    
    pinMode(RsupplyPIN, OUTPUT);   
    pinMode(RvaluePIN, INPUT); 
    pinMode(RgroundPIN, OUTPUT);
  
    digitalWrite(RgroundPIN, LOW);   
    digitalWrite(RsupplyPIN, HIGH);   
    
  Serial.begin(9600);    
} 
 
void loop() 
{ 
  int PWMvalue;
  
  Rvalue = analogRead(RvaluePIN);

  delay(30); 
  
  if (Rvalue<=RvalueMIN)Rvalue=RvalueMIN;
  if (Rvalue>=RvalueMAX)Rvalue=RvalueMAX;
  
  Rvalue-=RvalueZERO;
  
  if (Rvalue>=0)
  {Direction=1;
  PWMvalue=255-(10*abs(Rvalue));}
  else
  {Direction=0;
  PWMvalue=10*abs(Rvalue);}
    
    digitalWrite(M2, Direction);       
    analogWrite(E2, PWMvalue);   //PWM Speed Control 
  
}

It's normal when the PWM pin is controlling one of the two half-bridge circuits. If HIGH means "make this side positive" and LOW means "make this side negative" the motor only moves when the two sides are unequal.

Since the PWM signal sets the portion of the time the signal is HIGH that sets the portion of time that side is positive. The rest of the time that side will be negative. If the other side is LOW (negative) then having the PWM side HIGH (positive) will turn the motor on: 255 is ON and 0 is OFF. If the other side is HIGH (positive) then having the PWM side HIGH (positive) will turn the motor off: 255 is OFF and 0 is ON.

You might be able to move the PWM signal to an Enable line. This will turn both sides on and off together.