Pin 5/9 PWM Out difference

Hi,

My system: Arduino Uno and Multi-function Shield.

I programmed simple Code to change PWM out with onboard Potentiometer.

The problem: output 5 behaves as expected if I switch Code to Out 9
PWM signal does not correspond to Potentiometer changer, but rather stays
the same till Pot reaches the Highest Value of 255 Than PWM is Full ON

/*----------------------------------------------------
Name: LedByPotentiometer.

Description: Varies the brightness of the leds based on
             the value read in from the potentiometer.



#include <TimerOne.h>
#include <Wire.h>
#include <MultiFuncShield.h>
#define DEBUG 1 // 0 - Turn off serial monitor - 1 turn on.

int pinLedD1 = 13;  // Define the D1 pin as led (on most arduino boards this is NOT a PWM pin.
int pinLedD2 = 12;  // Define the D2 pin as led (on most arduino boards this is NOT a PWM pin.
int pinLedD3 = 11;  // Define the D3 pin as led.
int pinLedD4 = 10;  // Define the D4 pin as led.
int motorPWM = 5; // Define Motor PWM pin

int pinPotentiometer = A0;  // Define Analog pin A0 as Potentiometer.

unsigned int uiPotentiometerValue = 0; 

void setup()
{
   Timer1.initialize();
  MFS.initialize(&Timer1);    // initialize multi-function shield library
  #if DEBUG
    Serial.begin(9600); // Set baud rate to 9600.
  #endif
  // Define the led pins to be output.  
  pinMode(pinLedD1, OUTPUT); 
  pinMode(pinLedD2, OUTPUT); 
  pinMode(pinLedD3, OUTPUT); 
  pinMode(pinLedD4, OUTPUT);
  pinMode(motorPWM, OUTPUT); 
}

void loop()
{
  unsigned int uiPWM; // Pulse width modulation value.
  
  uiPotentiometerValue = analogRead(pinPotentiometer);  
  // Sensor resolution is 0 - 1023.  
  // PWM has range of 0 - 255 therefore divide by 4.
  uiPWM = uiPotentiometerValue / 4;
  int LEDPWM = uiPWM;
  MFS.write(LEDPWM);
  analogWrite(motorPWM, LEDPWM);  // PWM Motor Drive
  #if DEBUG
    // Output text to serial port.
    Serial.print("Potentiometer = ");
    Serial.print(uiPotentiometerValue); 
    
    Serial.print("  PWN Value = ");
    Serial.println(uiPWM); 
    
  #endif
  
  // Set the level of brightness.
  analogWrite(pinLedD1, (255 - uiPWM)); // Not a PWM pin - will be on or off.
  analogWrite(pinLedD2, uiPWM);         // Not a PWM pin - will be on or off. 
  analogWrite(pinLedD3, (255 - uiPWM)); // Reverse to show contrast.
  analogWrite(pinLedD4, uiPWM);         
  
  delay(100); // Delay for 10th of a second.
}
#include <TimerOne.h>

Pin 9 uses Timer1 to create PWM. Will that still work with this library included? Or is the library taking over control of the timer?

Delta_G:

#include <TimerOne.h>

Pin 9 uses Timer1 to create PWM. Will that still work with this library included? Or is the library taking over control of the timer?

You are right, Library probably takes over.
But I’m still confused, why I do get confusing PWM signal from Out 9
that responds to Full Pot Value only.

Why? Reread the first sentence of your last reply for the answer. You said it yourself.

thank you